Skip to contentSkip to conversation

Fix combined usage of BISECT_REVERSE and BISECT_SKIP

PATCH Superseded Russ Dill 2 participants 6 messages Apr 23, 2012 – Apr 25, 2012 Ktest

lore
Share & tools
lore

Russ Dill

author
#0 lore raw

PATCH 1/1 Fix combined usage of BISECT_REVERSE and BISECT_SKIP

When BISECT_REVERSE and BISECT_SKIP are used together with boot or test testing, build failures are treated as boot or test failures and 'git bisect bad' is executed instead of 'git bisect good'. This is because the $ret value of -1 is treated as a build failure, but the $reverse_bisect logic does not properly handle this.

Simple fix, don't invert $ret if it is -1.

---
 tools/testing/ktest/ktest.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
index 95d6a6f..5221b00 100755
@@ -2192,7 +2192,7 @@ sub run_bisect {
     }
 
     # Are we looking for where it worked, not failed?
-    if ($reverse_bisect) {
+    if ($reverse_bisect && $ret != -1) {
 	$ret = !$ret;
     }
 
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v2 1/1 ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP

When BISECT_REVERSE and BISECT_SKIP are used together with boot or test testing, build failures are treated as boot or test failures and 'git bisect bad' is executed instead of 'git bisect skip'. This is because the $ret value of -1 is treated as a build failure, but the $reverse_bisect logic does not properly handle this.

Simple fix, don't invert $ret if it is -1.

---
 tools/testing/ktest/ktest.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
index 95d6a6f..5221b00 100755
@@ -2192,7 +2192,7 @@ sub run_bisect {
     }
 
     # Are we looking for where it worked, not failed?
-    if ($reverse_bisect) {
+    if ($reverse_bisect && $ret != -1) {
 	$ret = !$ret;
     }
 
Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

Re: [PATCH v2] ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP

Quoted 17 lines · Russ Dill

When BISECT_REVERSE and BISECT_SKIP are used together with boot or test testing, build failures are treated as boot or test failures and 'git bisect bad' is executed instead of 'git bisect skip'. This is because the $ret value of -1 is treated as a build failure, but the $reverse_bisect logic does not properly handle this.

Simple fix, don't invert $ret if it is -1.

---
 tools/testing/ktest/ktest.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +0 -0
index 95d6a6f..5221b00 100755

tools/testing/ktest/ktest.pl sub run_bisect { · line 2195

Quoted 5 lines
tools/testing/ktest/ktest.pl +1 -1
@@ -2192,7 +2192,7 @@ sub run_bisect {
     }
 
     # Are we looking for where it worked, not failed?
-    if ($reverse_bisect) {
+    if ($reverse_bisect && $ret != -1) {

Thanks! But can you resend with the following change:

	... && $ret >= 0) {

Just incase we have $ret be another negative number for something else.

-- Steve

Quoted 3 lines
tools/testing/ktest/ktest.pl +0 -0
 	$ret = !$ret;
     }
 
author
#3 lore raw

Re: [PATCH v2] ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP

Quoted 20 lines · Steven Rostedt
Quoted 19 lines · Russ Dill

When BISECT_REVERSE and BISECT_SKIP are used together with boot or test testing, build failures are treated as boot or test failures and 'git bisect bad' is executed instead of 'git bisect skip'. This is because the $ret value of -1 is treated as a build failure, but the $reverse_bisect logic does not properly handle this.

Simple fix, don't invert $ret if it is -1.

---
 tools/testing/ktest/ktest.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +0 -0
index 95d6a6f..5221b00 100755
@@ -2192,7 +2192,7 @@ sub run_bisect {
     }
 
Quoted 8 lines

tools/testing/ktest/ktest.pl sub run_bisect { · line 2195

Quoted 3 lines
tools/testing/ktest/ktest.pl +1 -1
     # Are we looking for where it worked, not failed?
-    if ($reverse_bisect) {
+    if ($reverse_bisect && $ret != -1) {

Thanks! But can you resend with the following change:

	... && $ret >= 0) {

Just incase we have $ret be another negative number for something else.

BTW, I can across an additional problem that I'm not sure how to solve. I'm using PRE_BUILD and POST_BUILD to apply a patch during a bisect. As soon as the bisect hits a tree where the patch applies, the module tar-up fails. The kernel version (and module path) has a '-dirty' but ktest.pl is calling its get_version after POST_BUILD when the tree is clean.

maintainer
#4 lore raw

Re: [PATCH v2] ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP

Quoted 5 lines · Russ Dill

BTW, I can across an additional problem that I'm not sure how to solve. I'm using PRE_BUILD and POST_BUILD to apply a patch during a bisect. As soon as the bisect hits a tree where the patch applies, the module tar-up fails. The kernel version (and module path) has a '-dirty' but ktest.pl is calling its get_version after POST_BUILD when the tree is clean.

I'm aware of this issue, as I hit this bug myself. I have some patches that fix it, but they are currently ugly. I'm working on a better fix.

Thanks,

-- Steve

author
#5 lore raw

PATCH v3 1/1 ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP

In reply to Russ Dill

v3: Ignore all negative values, not just -1.

When BISECT_REVERSE and BISECT_SKIP are used together with boot or test testing, build failures are treated as boot or test failures and 'git bisect bad' is executed instead of 'git bisect skip'. This is because the $ret value of -1 is treated as a build failure, but the $reverse_bisect logic does not properly handle this.

Simple fix, only invert it if it is positive.

---
 tools/testing/ktest/ktest.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
index 95d6a6f..d2ede59 100755
@@ -2192,7 +2192,7 @@ sub run_bisect {
     }
 
     # Are we looking for where it worked, not failed?
-    if ($reverse_bisect) {
+    if ($reverse_bisect && $ret >= 0) {
 	$ret = !$ret;
     }
 
Signature · 1 line
1.7.9.5