From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:19735 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754668Ab2G3TpD (ORCPT ); Mon, 30 Jul 2012 15:45:03 -0400 Message-Id: <20120730194501.990401960@goodmis.org> Date: Mon, 30 Jul 2012 15:43:18 -0400 From: Steven Rostedt Subject: [PATCH 2/4] localmodconfig: Read in orig config file to avoid extra processing References: <20120730194316.768288008@goodmis.org> Content-Disposition: inline; filename=0002-localmodconfig-Read-in-orig-config-file-to-avoid-ext.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Linus Torvalds --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt 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 # AlleyTrotter Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streaml= ine_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 { =20 find_config; =20 +# Read in the entire config file into config_file +my @config_file =3D ; +close CIN; + # Parse options my $localmodconfig =3D 0; my $localyesconfig =3D 0; @@ -392,7 +396,20 @@ foreach my $module (keys(%modules)) { } } =20 +# 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 =3D "A-Za-z_0-9"; + +foreach my $line (@config_file) { + $_ =3D $line; + + if (/(CONFIG_[$valid]*)=3D(m|y)/) { + $orig_configs{$1} =3D $2; + } +} + my $repeat =3D 1; =20 # @@ -414,6 +431,11 @@ sub parse_config_dep_select =20 $p =3D~ s/^[^$valid]*[$valid]+//; =20 + # 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; =20 # Finally, read the .config file and turn off any module enabled that # we could not find a reason to keep enabled. -while() { +foreach my $line (@config_file) { + $_ =3D $line; =20 if (/CONFIG_IKCONFIG/) { if (/# CONFIG_IKCONFIG is not set/) { @@ -478,7 +501,6 @@ while() { } print; } -close(CIN); =20 # Integrity check, make sure all modules that we want enabled do # indeed have their configs set. --=20 1.7.10.4 --00GvhwF7k39YY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJQFuQ+AAoJEIy3vGnGbaoAxnkP/00C5+mfLZf7S631XoIzVDP9 mh9YRBL8l3gBZGXFGfayTMfFkHt/E/JVy5m5I9h8xzYt4LTjw7o0TgnaUxz5nc8J CdUJESQ0mEGi+XNA2ML+YGNtfQJSvi8Gs1JNrSmk6Y8ek3fASx0JXNfHefgxPIwA Lqku1OHNvJtDwztO0+qVVK1nfyS2Pfp7E0nnUzHfCaEb0VY6kFtQg24wUfA878O8 mxoQ1BH2Oau+eQWrM3agosSbeY1nLvL6UZQdzkV4SA/ltdgQPDZ4jO5p944ArngO P7xbEAZOnjK5AJtQ+Qcy5NXqAiA5Hl2NLGsRiPvkxIixeeJD1kx5F7hP+Qe8obyp 5XQJIRyL+ATLQO2+pAE2OXQhnb3lMzGZzAw7qSZe5SMbJSYzW+NTneAviJOXL9DE c8VZbbzgO+xYnAB7Snpw5McQLirblGXfKyHvwLEfFA4ubFnu2e/VmFhRRk3XQ219 C3HayzUgxvlpAbAwKLBwEqv/Jt/jm5On8gLsp+e6L3vGiieB34MZuvGQ+0jkOuGa PH1VrwIOhWPh+qIYak96WPWjWVdkgpSCpZQWjoxKYn25awun+/QQwTmNvfnxCyjm BEH4QzndqYbABDy9eU6G6jZ1uTRjGXI3hC26JNdL1uovNm1DCTzxFBDoF0nIYWZ7 EUOzqLr2dr4yrhb1940N =3wF3 -----END PGP SIGNATURE----- --00GvhwF7k39YY--