From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 05/10] ktest: Fix config bisect with how make oldnoconfig works
Date: Mon, 30 Jul 2012 15:23:19 -0400 [thread overview]
Message-ID: <20120730192656.821059256@goodmis.org> (raw)
In-Reply-To: 20120730192314.144253843@goodmis.org
[-- Attachment #1: Type: text/plain, Size: 4330 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
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 <rostedt@goodmis.org>
---
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 = 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;
# do not force reboots on config problems
@@ -1837,6 +1840,7 @@ sub make_oldconfig {
sub load_force_config {
my ($config) = @_;
+ doprint "Loading force configs from $config\n";
open(IN, $config) or
dodie "failed to read $config";
while (<IN>) {
@@ -2389,9 +2393,24 @@ sub bisect {
success $i;
}
+# 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;
+# 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;
@@ -2470,6 +2489,16 @@ sub create_config {
}
}
+ # 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 = @start_list[0 .. $half];
+ # keep the bottom half off
+ if ($half < $#start_list) {
+ @config_off_tmp = @start_list[$half + 1 .. $#start_list];
+ } else {
+ @config_off_tmp = ();
+ }
+
create_config @tophalf;
read_current_config \%current_config;
@@ -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 = @tophalf;
@tophalf = @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} = $1;
$config_list{$2} = $1;
}
+ } elsif (/^# ((CONFIG\S*).*)/) {
+ # Keep these configs disabled
+ $config_set{$2} = $1;
+ $config_off{$2} = $1;
}
}
close(IN);
@@ -2727,6 +2771,8 @@ sub config_bisect {
my %config_test;
my $once = 0;
+ @config_off_tmp = ();
+
# 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
--
1.7.10.4
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-07-30 19:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 19:23 [PATCH 00/10] [GIT PULL] ktest: changes for v3.6 Steven Rostedt
2012-07-30 19:23 ` [PATCH 01/10] ktest: Remove commented exit Steven Rostedt
2012-07-30 19:23 ` [PATCH 02/10] ktest: Add PRE/POST_KTEST and TEST options Steven Rostedt
2012-07-30 19:23 ` [PATCH 03/10] ktest: Add PRE_INSTALL option Steven Rostedt
2012-07-30 19:23 ` [PATCH 04/10] ktest: Add CONFIG_BISECT_CHECK option Steven Rostedt
2012-07-30 19:23 ` Steven Rostedt [this message]
2012-07-30 19:23 ` [PATCH 06/10] ktest: Add MAX_MONITOR_WAIT option Steven Rostedt
2012-07-30 19:23 ` [PATCH 07/10] ktest: Add check for bug or panic during reboot Steven Rostedt
2012-07-30 19:23 ` [PATCH 08/10] ktest: Reset saved min (force) configs for each test Steven Rostedt
2012-07-30 19:23 ` [PATCH 09/10] ktest: Ignore errors it tests if IGNORE_ERRORS is set Steven Rostedt
2012-07-30 19:23 ` [PATCH 10/10] ktest: Allow perl regex expressions in conditional statements Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120730192656.821059256@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox