ftracetest: Convert exit -1 to exit $FAIL
PATCH v2 1/1 ftracetest: Convert exit -1 to exit $FAIL
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 <[email protected]>
---
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(-)
tools/testing/selftests/ftrace/test.d/00basic/basic4.tc +1 -1
@@ -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 +grep -q sched available_events && exit 0 || exit $FAIL
tools/testing/selftests/ftrace/test.d/event/event-enable.tc +1 -1
@@ -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
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +1 -1
@@ -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
tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc +1 -1
@@ -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
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc +1 -1
@@ -25,7 +25,7 @@ do_reset() { fail() { # msg do_reset echo $1 - exit -1 + exit $FAIL } disable_tracing
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc +1 -1
@@ -17,7 +17,7 @@ do_reset() { fail() { # msg do_reset echo $1 - exit -1 + exit $FAIL } disable_tracing
tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc +1 -1
@@ -31,7 +31,7 @@ fail() { # mesg reset_tracer echo > set_ftrace_filter echo $1 - exit -1 + exit $FAIL } echo "Testing function tracer with profiler:"
Signature · 1 line
2.1.0
Quoted 6 lines · On Mon, 30 Mar 2015 16:21:00 +1100 Michael Ellerman <[email protected]> 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 <[email protected]>
Acked-by Steven Rostedt <[email protected]>
-- Steve
Quoted 13 lines
---
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(-)
Quoted 12 lines · Steven Rostedt
Quoted 6 lines · On Mon, 30 Mar 2015 16:21:00 +1100 Michael Ellerman <[email protected]> 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 <[email protected]>Acked-by Steven Rostedt <[email protected]>
Applied to linux-kselftest next for 4.1
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978