[PATCH v1 4/7] streamline_config.pl: include tool to learn about a config option

From: David Hunter
Date: Mon Oct 14 2024 - 10:14:52 EST


Include a debugging tool that can help developers find out about a
particular config option.

It can be challenging to find out what is going on behind the scenes of
the script due to the vast amount of config options and the ways the
config options interact with each other.

Signed-off-by: David Hunter <david.hunter.linux@xxxxxxxxx>
---
scripts/kconfig/streamline_config.pl | 49 ++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index f5a07b3a1922..bbcd5a6e9726 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -713,4 +713,53 @@ foreach my $module (keys(%modules)) {
}
}

+# the following tool can be used to check a particular config option.
+# You can read the output if the variable "debugprint" is set to "1."
+# Here is a sample way to use the tool:
+# dprintvar("INET_ESP");
+#
+sub dprintvar {
+ if ($debugprint) {
+ my $dconfig = $_[0];
+ my $fconfig = "CONFIG_$dconfig";
+ my $con_found = "";
+ my $dep_found = "";
+ my $def_found = "";
+ my $sel_found = "";
+ my $prom_found = "";
+ my $ori_found = "";
+ my $proc_found = "";
+
+ if (defined($configs{$fconfig})) {
+ $con_found = $configs{$fconfig};
+ }
+ if (defined($depends{$dconfig})) {
+ $dep_found = $depends{$dconfig};
+ }
+ if (defined($defaults{$dconfig})) {
+ $def_found = $defaults{$dconfig};
+ }
+ if (defined($selects{$dconfig})) {
+ $sel_found = $selects{$dconfig};
+ }
+ if (defined($prompts{$dconfig})) {
+ $prom_found = $prompts{$dconfig};
+ }
+ if (defined($orig_configs{$fconfig})) {
+ $ori_found = $orig_configs{$fconfig};
+ }
+ if (defined($process_selects{$dconfig})) {
+ $proc_found = $process_selects{$dconfig};
+ }
+
+ dprint "config: $dconfig\n";
+ dprint "config found: $con_found\n";
+ dprint "depends: $dep_found\n";
+ dprint "defaults: $def_found\n";
+ dprint "selects: $sel_found\n";
+ dprint "prompts: $prom_found\n";
+ dprint "in original config: $ori_found\n";
+ dprint "process selected: $proc_found\n";
+ }
+}
# vim: softtabstop=4
--
2.43.0