summaryrefslogtreecommitdiffstats
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)
downloadop-kernel-dev-4f4c51c9405a509e9073ff242746e9049c723aae.zip
op-kernel-dev-4f4c51c9405a509e9073ff242746e9049c723aae.tar.gz
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 5c1ce87..ab4985f 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -113,6 +113,10 @@ sub find_config {
find_config;
+# Read in the entire config file into config_file
+my @config_file = <CIN>;
+close CIN;
+
# Parse options
my $localmodconfig = 0;
my $localyesconfig = 0;
@@ -392,7 +396,20 @@ foreach my $module (keys(%modules)) {
}
}
+# Read the current config, and see what is enabled. We want to
+# ignore configs that we would not enable anyway.
+
+my %orig_configs;
my $valid = "A-Za-z_0-9";
+
+foreach my $line (@config_file) {
+ $_ = $line;
+
+ if (/(CONFIG_[$valid]*)=(m|y)/) {
+ $orig_configs{$1} = $2;
+ }
+}
+
my $repeat = 1;
#
@@ -414,6 +431,11 @@ sub parse_config_dep_select
$p =~ s/^[^$valid]*[$valid]+//;
+ # We only need to process if the depend config is a module
+ if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") {
+ next;
+ }
+
if (!defined($configs{$conf})) {
# We must make sure that this config has its
# dependencies met.
@@ -450,7 +472,8 @@ my %setconfigs;
# Finally, read the .config file and turn off any module enabled that
# we could not find a reason to keep enabled.
-while(<CIN>) {
+foreach my $line (@config_file) {
+ $_ = $line;
if (/CONFIG_IKCONFIG/) {
if (/# CONFIG_IKCONFIG is not set/) {
@@ -478,7 +501,6 @@ while(<CIN>) {
}
print;
}
-close(CIN);
# Integrity check, make sure all modules that we want enabled do
# indeed have their configs set.
OpenPOWER on IntegriCloud