aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-06-18 21:43:53 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-06-19 15:03:05 -0400
commit4f4c51c9405a509e9073ff242746e9049c723aae (patch)
treee729ede1466683c8a6a4b316bf3e362179c2265d /scripts
parent0b58a99eb27aa522a3cd16ece09c8045b322b9ce (diff)
localmodconfig: Read in orig config file to avoid extra processing
Read in the entire config file. If there's a config that we depend on that happens to be in the core set (not a module) then we do not need to process it as a module. Currently, we follow the entire depend and selects even if they are enabled as core and not modules. By checking to make sure that we only look at modules we can drop the count a little. From one of my tests, localmodconfig went from taking 3095 set modules down to 356 before this patch, and down to 290 modules after the change. Tested-by: John David Yost <johnyost@ptd.net> # AlleyTrotter Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/streamline_config.pl26
1 files changed, 24 insertions, 2 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 5c1ce8761205..ab4985f7af79 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -113,6 +113,10 @@ sub find_config {
113 113
114find_config; 114find_config;
115 115
116# Read in the entire config file into config_file
117my @config_file = <CIN>;
118close CIN;
119
116# Parse options 120# Parse options
117my $localmodconfig = 0; 121my $localmodconfig = 0;
118my $localyesconfig = 0; 122my $localyesconfig = 0;
@@ -392,7 +396,20 @@ foreach my $module (keys(%modules)) {
392 } 396 }
393} 397}
394 398
399# Read the current config, and see what is enabled. We want to
400# ignore configs that we would not enable anyway.
401
402my %orig_configs;
395my $valid = "A-Za-z_0-9"; 403my $valid = "A-Za-z_0-9";
404
405foreach my $line (@config_file) {
406 $_ = $line;
407
408 if (/(CONFIG_[$valid]*)=(m|y)/) {
409 $orig_configs{$1} = $2;
410 }
411}
412
396my $repeat = 1; 413my $repeat = 1;
397 414
398# 415#
@@ -414,6 +431,11 @@ sub parse_config_dep_select
414 431
415 $p =~ s/^[^$valid]*[$valid]+//; 432 $p =~ s/^[^$valid]*[$valid]+//;
416 433
434 # We only need to process if the depend config is a module
435 if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") {
436 next;
437 }
438
417 if (!defined($configs{$conf})) { 439 if (!defined($configs{$conf})) {
418 # We must make sure that this config has its 440 # We must make sure that this config has its
419 # dependencies met. 441 # dependencies met.
@@ -450,7 +472,8 @@ my %setconfigs;
450 472
451# Finally, read the .config file and turn off any module enabled that 473# Finally, read the .config file and turn off any module enabled that
452# we could not find a reason to keep enabled. 474# we could not find a reason to keep enabled.
453while(<CIN>) { 475foreach my $line (@config_file) {
476 $_ = $line;
454 477
455 if (/CONFIG_IKCONFIG/) { 478 if (/CONFIG_IKCONFIG/) {
456 if (/# CONFIG_IKCONFIG is not set/) { 479 if (/# CONFIG_IKCONFIG is not set/) {
@@ -478,7 +501,6 @@ while(<CIN>) {
478 } 501 }
479 print; 502 print;
480} 503}
481close(CIN);
482 504
483# Integrity check, make sure all modules that we want enabled do 505# Integrity check, make sure all modules that we want enabled do
484# indeed have their configs set. 506# indeed have their configs set.