diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-06-18 22:41:15 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-06-19 15:03:06 -0400 |
commit | 4503379cb811809470ebefb58c943fe605bc3e29 (patch) | |
tree | d1696a5e9393fec6fe83bc09f8f230bdcef3fa11 /scripts | |
parent | d4bb58b5cb3b6fbf89d0012c199be3954cba9fb3 (diff) |
localmodconfig: Add debug environment variable LOCALMODCONFIG_DEBUG
If the environment variable LOCALMODCONFIG_DEBUG is set, then debug output
will appear in the make localmodconfig. This will simplify debugging what
people get with their output, as I can just tell people to do:
LOCALMODCONFIG_DEBUG=1 make localmodconfig 2>out.txt
and have them send me the out.txt. I'll be able to see why things are not
working as they think it should be.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index fcfcb302b0d..2fbbbc1ddea 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -45,6 +45,16 @@ | |||
45 | use strict; | 45 | use strict; |
46 | use Getopt::Long; | 46 | use Getopt::Long; |
47 | 47 | ||
48 | # set the environment variable LOCALMODCONFIG_DEBUG to get | ||
49 | # debug output. | ||
50 | my $debugprint = 0; | ||
51 | $debugprint = 1 if (defined($ENV{LOCALMODCONFIG_DEBUG})); | ||
52 | |||
53 | sub dprint { | ||
54 | return if (!$debugprint); | ||
55 | print STDERR @_; | ||
56 | } | ||
57 | |||
48 | my $config = ".config"; | 58 | my $config = ".config"; |
49 | 59 | ||
50 | my $uname = `uname -r`; | 60 | my $uname = `uname -r`; |
@@ -389,6 +399,7 @@ foreach my $module (keys(%modules)) { | |||
389 | my @arr = @{$objects{$module}}; | 399 | my @arr = @{$objects{$module}}; |
390 | foreach my $conf (@arr) { | 400 | foreach my $conf (@arr) { |
391 | $configs{$conf} = $module; | 401 | $configs{$conf} = $module; |
402 | dprint "$conf added by direct ($module)\n"; | ||
392 | } | 403 | } |
393 | } else { | 404 | } else { |
394 | # Most likely, someone has a custom (binary?) module loaded. | 405 | # Most likely, someone has a custom (binary?) module loaded. |
@@ -412,6 +423,8 @@ foreach my $line (@config_file) { | |||
412 | 423 | ||
413 | my $repeat = 1; | 424 | my $repeat = 1; |
414 | 425 | ||
426 | my $depconfig; | ||
427 | |||
415 | # | 428 | # |
416 | # Note, we do not care about operands (like: &&, ||, !) we want to add any | 429 | # Note, we do not care about operands (like: &&, ||, !) we want to add any |
417 | # config that is in the depend list of another config. This script does | 430 | # config that is in the depend list of another config. This script does |
@@ -440,6 +453,7 @@ sub parse_config_depends | |||
440 | # We must make sure that this config has its | 453 | # We must make sure that this config has its |
441 | # dependencies met. | 454 | # dependencies met. |
442 | $repeat = 1; # do again | 455 | $repeat = 1; # do again |
456 | dprint "$conf selected by depend $depconfig\n"; | ||
443 | $configs{$conf} = 1; | 457 | $configs{$conf} = 1; |
444 | } | 458 | } |
445 | } else { | 459 | } else { |
@@ -473,15 +487,18 @@ sub parse_config_selects | |||
473 | 487 | ||
474 | # Make sure that this config exists in the current .config file | 488 | # Make sure that this config exists in the current .config file |
475 | if (!defined($orig_configs{$conf})) { | 489 | if (!defined($orig_configs{$conf})) { |
490 | dprint "$conf not set for $config select\n"; | ||
476 | next; | 491 | next; |
477 | } | 492 | } |
478 | 493 | ||
479 | # Check if something other than a module selects this config | 494 | # Check if something other than a module selects this config |
480 | if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") { | 495 | if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") { |
496 | dprint "$conf (non module) selects config, we are good\n"; | ||
481 | # we are good with this | 497 | # we are good with this |
482 | return; | 498 | return; |
483 | } | 499 | } |
484 | if (defined($configs{$conf})) { | 500 | if (defined($configs{$conf})) { |
501 | dprint "$conf selects $config so we are good\n"; | ||
485 | # A set config selects this config, we are good | 502 | # A set config selects this config, we are good |
486 | return; | 503 | return; |
487 | } | 504 | } |
@@ -506,6 +523,7 @@ sub parse_config_selects | |||
506 | $repeat = 1; | 523 | $repeat = 1; |
507 | # Make this config need to be selected | 524 | # Make this config need to be selected |
508 | $configs{$next_config} = 1; | 525 | $configs{$next_config} = 1; |
526 | dprint "$next_config selected by select $config\n"; | ||
509 | } | 527 | } |
510 | 528 | ||
511 | my %process_selects; | 529 | my %process_selects; |
@@ -526,6 +544,7 @@ sub loop_depend { | |||
526 | } | 544 | } |
527 | 545 | ||
528 | $config =~ s/^CONFIG_//; | 546 | $config =~ s/^CONFIG_//; |
547 | $depconfig = $config; | ||
529 | 548 | ||
530 | if (defined($depends{$config})) { | 549 | if (defined($depends{$config})) { |
531 | # This config has dependencies. Make sure they are also included | 550 | # This config has dependencies. Make sure they are also included |
@@ -546,6 +565,8 @@ sub loop_select { | |||
546 | foreach my $config (keys %process_selects) { | 565 | foreach my $config (keys %process_selects) { |
547 | $config =~ s/^CONFIG_//; | 566 | $config =~ s/^CONFIG_//; |
548 | 567 | ||
568 | dprint "Process select $config\n"; | ||
569 | |||
549 | # config has no prompt and must be selected. | 570 | # config has no prompt and must be selected. |
550 | parse_config_selects $config, $selects{$config}; | 571 | parse_config_selects $config, $selects{$config}; |
551 | } | 572 | } |