mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] [GIT PULL] ktest: fixes for config_bisect
@ 2011-06-02 19:13 Steven Rostedt
  2011-06-02 19:13 ` [PATCH 1/3] ktest: Fix off-by-one in config bisect result Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-06-02 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Andrew Morton

Linus,

As I've been doing a bit of config_bisects with ktest lately, I've
discovered a few minor bugs that can cause it to give the wrong result.

Two of the patches fix the config_bisect, and one fixes the error
path, if for some reason your reboot fails to reboot the remote box.

Note, I've notice problems with git.kernel.org mirroring, and
a fetch can result in the old version of the branch or the new version.
The top commit should be:

  commit 9bf7174949aef2f43253956e1f3ab01698abbd79
  Author: Steven Rostedt <srostedt@redhat.com>
  Date:   Wed Jun 1 23:27:19 2011 -0400
  ktest: Ignore unset values of the minconfig in config_bisect


Please pull the following patches from:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-ktest.git

    branch: for-linus


Steven Rostedt (3):
      ktest: Fix off-by-one in config bisect result
      ktest: Fix result of rebooting the kernel
      ktest: Ignore unset values of the minconfig in config_bisect

----
 tools/testing/ktest/ktest.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] ktest: Fix off-by-one in config bisect result
  2011-06-02 19:13 [PATCH 0/3] [GIT PULL] ktest: fixes for config_bisect Steven Rostedt
@ 2011-06-02 19:13 ` Steven Rostedt
  2011-06-02 19:13 ` [PATCH 2/3] ktest: Fix result of rebooting the kernel Steven Rostedt
  2011-06-02 19:13 ` [PATCH 3/3] ktest: Ignore unset values of the minconfig in config_bisect Steven Rostedt
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-06-02 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Andrew Morton

[-- Attachment #1: 0001-ktest-Fix-off-by-one-in-config-bisect-result.patch --]
[-- Type: text/plain, Size: 1355 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Because in perl the array size returned by $#arr, is the last
index and not the actually size of the array, we end the config
bisect early, thinking there is only one config left when there
are in fact two. Thus the result has a 50% chance of picking
the correct config that caused the problem.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 1fd29b2..8dc8c3c 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1638,7 +1638,7 @@ sub run_config_bisect {
 	if (!$found) {
 	    # try the other half
 	    doprint "Top half produced no set configs, trying bottom half\n";
-	    @tophalf = @start_list[$half .. $#start_list];
+	    @tophalf = @start_list[$half + 1 .. $#start_list];
 	    create_config @tophalf;
 	    read_current_config \%current_config;
 	    foreach my $config (@tophalf) {
@@ -1690,7 +1690,7 @@ sub run_config_bisect {
 	# remove half the configs we are looking at and see if
 	# they are good.
 	$half = int($#start_list / 2);
-    } while ($half > 0);
+    } while ($#start_list > 0);
 
     # we found a single config, try it again unless we are running manually
 
-- 
1.7.4.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ktest: Fix result of rebooting the kernel
  2011-06-02 19:13 [PATCH 0/3] [GIT PULL] ktest: fixes for config_bisect Steven Rostedt
  2011-06-02 19:13 ` [PATCH 1/3] ktest: Fix off-by-one in config bisect result Steven Rostedt
@ 2011-06-02 19:13 ` Steven Rostedt
  2011-06-02 19:13 ` [PATCH 3/3] ktest: Ignore unset values of the minconfig in config_bisect Steven Rostedt
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-06-02 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Andrew Morton

[-- Attachment #1: 0002-ktest-Fix-result-of-rebooting-the-kernel.patch --]
[-- Type: text/plain, Size: 986 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The command that is called that reboots the kernel may fail
but the return code is not passed back to the ktest.pl script.
This is because a ';' is used between the two commands and
if the second command fails, only the first command's return
code is returned. Using a '&&' between the two commands fixes
this.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 8dc8c3c..6c68259 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -788,7 +788,7 @@ sub wait_for_input
 
 sub reboot_to {
     if ($reboot_type eq "grub") {
-	run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch; reboot)'";
+	run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch && reboot)'";
 	return;
     }
 
-- 
1.7.4.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ktest: Ignore unset values of the minconfig in config_bisect
  2011-06-02 19:13 [PATCH 0/3] [GIT PULL] ktest: fixes for config_bisect Steven Rostedt
  2011-06-02 19:13 ` [PATCH 1/3] ktest: Fix off-by-one in config bisect result Steven Rostedt
  2011-06-02 19:13 ` [PATCH 2/3] ktest: Fix result of rebooting the kernel Steven Rostedt
@ 2011-06-02 19:13 ` Steven Rostedt
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2011-06-02 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Andrew Morton

[-- Attachment #1: 0003-ktest-Ignore-unset-values-of-the-minconfig-in-config.patch --]
[-- Type: text/plain, Size: 810 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

By ignoring the unset values of the minconfig in deciding
what to test in the config_bisect can cause the problem
config from being tested too.

Just do not test the configs that are set in the minconfig.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 6c68259..cef28e6 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1480,7 +1480,7 @@ sub process_config_ignore {
 	or dodie "Failed to read $config";
 
     while (<IN>) {
-	if (/^(.*?(CONFIG\S*)(=.*| is not set))/) {
+	if (/^((CONFIG\S*)=.*)/) {
 	    $config_ignore{$2} = $1;
 	}
     }
-- 
1.7.4.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-02 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-02 19:13 [PATCH 0/3] [GIT PULL] ktest: fixes for config_bisect Steven Rostedt
2011-06-02 19:13 ` [PATCH 1/3] ktest: Fix off-by-one in config bisect result Steven Rostedt
2011-06-02 19:13 ` [PATCH 2/3] ktest: Fix result of rebooting the kernel Steven Rostedt
2011-06-02 19:13 ` [PATCH 3/3] ktest: Ignore unset values of the minconfig in config_bisect Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome