LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] ftracetest: Convert exit -1 to exit $FAIL
@ 2015-03-30  5:21 Michael Ellerman
  2015-03-30 19:50 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2015-03-30  5:21 UTC (permalink / raw)
  To: shuahkh; +Cc: rostedt, linux-kernel, davej, namhyung

POSIX says that exit takes an unsigned integer between 0 and 255, so
using -1 doesn't work on POSIX shells.

There is already a well-defined failure code, $FAIL (1), so use that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---

v2: Use exit $FAIL not exit 255.

 tools/testing/selftests/ftrace/test.d/00basic/basic4.tc             | 2 +-
 tools/testing/selftests/ftrace/test.d/event/event-enable.tc         | 2 +-
 tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc     | 2 +-
 tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc      | 2 +-
 tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc | 2 +-
 tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc       | 2 +-
 tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc       | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
index fd9c49a13612..aa51f6c17359 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
@@ -2,4 +2,4 @@
 # description: Basic event tracing check
 test -f available_events -a -f set_event -a -d events
 # check scheduler events are available
-grep -q sched available_events && exit 0 || exit -1
\ No newline at end of file
+grep -q sched available_events && exit 0 || exit $FAIL
diff --git a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
index 668616d9bb03..dbddb7836f73 100644
--- a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f set_event -o ! -d events/sched ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
index 655c415b6e7f..ef9b95dc10c5 100644
--- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f set_event -o ! -d events/sched ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
index 480845774007..af8cf01fc3a7 100644
--- a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f available_events -o ! -f set_event -o ! -d events ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
index c15e018e0220..c652c06b231f 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
@@ -25,7 +25,7 @@ do_reset() {
 fail() { # msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 disable_tracing
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
index 6af5f6360b18..0ab2189613ef 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
@@ -17,7 +17,7 @@ do_reset() {
 fail() { # msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 disable_tracing
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
index 2e719cb1fc4d..7808336d6f50 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
@@ -31,7 +31,7 @@ fail() { # mesg
     reset_tracer
     echo > set_ftrace_filter
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 echo "Testing function tracer with profiler:"
-- 
2.1.0


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

* Re: [PATCH v2] ftracetest: Convert exit -1 to exit $FAIL
  2015-03-30  5:21 [PATCH v2] ftracetest: Convert exit -1 to exit $FAIL Michael Ellerman
@ 2015-03-30 19:50 ` Steven Rostedt
  2015-03-31 16:17   ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2015-03-30 19:50 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: shuahkh, linux-kernel, davej, namhyung

On Mon, 30 Mar 2015 16:21:00 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:

> POSIX says that exit takes an unsigned integer between 0 and 255, so
> using -1 doesn't work on POSIX shells.
> 
> There is already a well-defined failure code, $FAIL (1), so use that.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> ---
> 
> v2: Use exit $FAIL not exit 255.
> 
>  tools/testing/selftests/ftrace/test.d/00basic/basic4.tc             | 2 +-
>  tools/testing/selftests/ftrace/test.d/event/event-enable.tc         | 2 +-
>  tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc     | 2 +-
>  tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc      | 2 +-
>  tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc | 2 +-
>  tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc       | 2 +-
>  tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc       | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 

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

* Re: [PATCH v2] ftracetest: Convert exit -1 to exit $FAIL
  2015-03-30 19:50 ` Steven Rostedt
@ 2015-03-31 16:17   ` Shuah Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2015-03-31 16:17 UTC (permalink / raw)
  To: Steven Rostedt, Michael Ellerman; +Cc: linux-kernel, davej, namhyung

On 03/30/2015 01:50 PM, Steven Rostedt wrote:
> On Mon, 30 Mar 2015 16:21:00 +1100
> Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
>> POSIX says that exit takes an unsigned integer between 0 and 255, so
>> using -1 doesn't work on POSIX shells.
>>
>> There is already a well-defined failure code, $FAIL (1), so use that.
>>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> Acked-by: Steven Rostedt <rostedt@goodmis.org>
> 

Applied to linux-kselftest next for 4.1

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

end of thread, other threads:[~2015-03-31 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30  5:21 [PATCH v2] ftracetest: Convert exit -1 to exit $FAIL Michael Ellerman
2015-03-30 19:50 ` Steven Rostedt
2015-03-31 16:17   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).