From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754975Ab2G3T15 (ORCPT ); Mon, 30 Jul 2012 15:27:57 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:4399 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754747Ab2G3T07 (ORCPT ); Mon, 30 Jul 2012 15:26:59 -0400 X-Authority-Analysis: v=2.0 cv=LIjkseq9 c=1 sm=0 a=s5Htg7xnQOKvHEu9STBOug==:17 a=OpT9cpI26MMA:10 a=Ciwy3NGCPMMA:10 a=gd_MD5GRgqsA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=meVymXHHAAAA:8 a=20KFwNOVAAAA:8 a=rBh6FFy8A829BRAkTzIA:9 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=zaT1LpOFqbnKaxiXnDQA:9 a=s5Htg7xnQOKvHEu9STBOug==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.230.195.127 Message-Id: <20120730192656.821059256@goodmis.org> User-Agent: quilt/0.60-1 Date: Mon, 30 Jul 2012 15:23:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 05/10] ktest: Fix config bisect with how make oldnoconfig works References: <20120730192314.144253843@goodmis.org> Content-Disposition: inline; filename=0005-ktest-Fix-config-bisect-with-how-make-oldnoconfig-wo.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt With a name like 'oldnoconfig' one may think that the config generated would disable all configs that were not defined (selecting "no" for all options). But this is not the case. It selects the default. If a config has a 'default y', then it is added if not specified. This broke the config bisect, because options not specified by a config will just use the default, where it expected to turn off. This caused an option to be enabled that disabled an option that would break the build. The end result was that we never found the bad config at the end of the test. Instead of using 'make oldnoconfig', ktest now builds the options it expects enabled and disabled. When it turns off an option, it will no longer remove it, but actually set it to: # CONFIG_FOO is not set. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 46 ++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 46 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 8ce58d7..5ad891a 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -189,6 +189,9 @@ my $newconfig =3D 0; my %entered_configs; my %config_help; my %variable; + +# force_config is the list of configs that we force enabled (or disabled) +# in a .config file. The MIN_CONFIG and ADD_CONFIG configs. my %force_config; =20 # do not force reboots on config problems @@ -1837,6 +1840,7 @@ sub make_oldconfig { sub load_force_config { my ($config) =3D @_; =20 + doprint "Loading force configs from $config\n"; open(IN, $config) or dodie "failed to read $config"; while () { @@ -2389,9 +2393,24 @@ sub bisect { success $i; } =20 +# config_ignore holds the configs that were set (or unset) for +# a good config and we will ignore these configs for the rest +# of a config bisect. These configs stay as they were. my %config_ignore; + +# config_set holds what all configs were set as. my %config_set; =20 +# config_off holds the set of configs that the bad config had disabled. +# We need to record them and set them in the .config when running +# oldnoconfig, because oldnoconfig does not turn off new symbols, but +# instead just keeps the defaults. +my %config_off; + +# config_off_tmp holds a set of configs to turn off for now +my @config_off_tmp; + +# config_list is the set of configs that are being tested my %config_list; my %null_config; =20 @@ -2470,6 +2489,16 @@ sub create_config { } } =20 + # turn off configs to keep off + foreach my $config (keys %config_off) { + print OUT "# $config is not set\n"; + } + + # turn off configs that should be off for now + foreach my $config (@config_off_tmp) { + print OUT "# $config is not set\n"; + } + foreach my $config (keys %config_ignore) { print OUT "$config_ignore{$config}\n"; } @@ -2551,6 +2580,13 @@ sub run_config_bisect { do { my @tophalf =3D @start_list[0 .. $half]; =20 + # keep the bottom half off + if ($half < $#start_list) { + @config_off_tmp =3D @start_list[$half + 1 .. $#start_list]; + } else { + @config_off_tmp =3D (); + } + create_config @tophalf; read_current_config \%current_config; =20 @@ -2567,7 +2603,11 @@ sub run_config_bisect { if (!$found) { # try the other half doprint "Top half produced no set configs, trying bottom half\n"; + + # keep the top half off + @config_off_tmp =3D @tophalf; @tophalf =3D @start_list[$half + 1 .. $#start_list]; + create_config @tophalf; read_current_config \%current_config; foreach my $config (@tophalf) { @@ -2705,6 +2745,10 @@ sub config_bisect { $added_configs{$2} =3D $1; $config_list{$2} =3D $1; } + } elsif (/^# ((CONFIG\S*).*)/) { + # Keep these configs disabled + $config_set{$2} =3D $1; + $config_off{$2} =3D $1; } } close(IN); @@ -2727,6 +2771,8 @@ sub config_bisect { my %config_test; my $once =3D 0; =20 + @config_off_tmp =3D (); + # Sometimes kconfig does weird things. We must make sure # that the config we autocreate has everything we need # to test, otherwise we may miss testing configs, or --=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) iQIcBAABAgAGBQJQFuAAAAoJEIy3vGnGbaoAeisP/1rovXjHkXc6Oz2KYr14aCn9 Yi5Rg837YFMNLnKPZ6xkPITd+umXYeMqWMFHTUkr2FKV8evuWBmIA4iX4P4L5Sbl N/eSh0ta/UffbzugtESlJHAjJVUeRZUi9BpBaLMaoAWbc7CRse2njUW7y+3bFJNL 77lbcyyVTer8oVEyfxCsGpUBEBLLv0HXtcYCRWKuEX/6/rFIpRvbL96d8JMtNYrg 74pVRYLT5e8xNCphw0LovatazfljUVaSTnfGelsTGZa/5kj6IEv6YQFBqfnLtpxq 4o/dCwsVsgvkIcUZmXVKBtMEe3OUXbvoW7hCytiaAHjQb+7aBXcQX5zghZG2Rz1Z zAGLk7mRgRxs09ywhVFL5dOYC/MSG0JxknfUVvL+aEoaHQl0vmfBjydwh3zCbZpv JPwE7y/fREYyxPm7a79cr3kjllmn+mmMIiAnvYFh6BYXQ4Ilw/wJjM3y2/Y6czAh ClRIZbSU4QPDE0ry+wFjHSkPXRjg/dMFW4cB9b1/5B8g79EDaMwNfD6r5ntLJf/t S2f9+k5MNqXNBWkgUZWkkYYid8xlsB3WGsx8pEbIS/CGLXg0qkYD5y7+de8X3xsX NDUkk5LY2tOX6JIQ9ZO+L/nJMQAf0mOl8jQWYu6R5rN6QktL3zXu0RMBEl4R1Kdk TWbDG1tTSbWg0K8cSj3p =ec6U -----END PGP SIGNATURE----- --00GvhwF7k39YY--