summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:12:55 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:34 -0600
commit9d954f9519707bc0af29ead8b1dedc660306da1b (patch)
tree679c28ff07256e22b0b49a2d4189af460a5540dd /tools/testing/selftests/ftrace
parent84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d (diff)
downloadlinux-rt-9d954f9519707bc0af29ead8b1dedc660306da1b.tar.gz
selftests/ftrace: Add --stop-fail hidden option for debug
Add --stop-fail option for debugging the ftracetest. With this option, ftracetest stops right after a testcase fails instead of finish running all testcases. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/ftrace')
-rwxr-xr-xtools/testing/selftests/ftrace/ftracetest13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index f9a9d424c980..c9c7fa8dc440 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -69,6 +69,10 @@ parse_opts() { # opts
DEBUG=1
shift 1
;;
+ --stop-fail)
+ STOP_FAILURE=1
+ shift 1
+ ;;
--fail-unsupported)
UNSUPPORTED_RESULT=1
shift 1
@@ -117,6 +121,7 @@ KEEP_LOG=0
DEBUG=0
VERBOSE=0
UNSUPPORTED_RESULT=0
+STOP_FAILURE=0
# Parse command-line options
parse_opts $*
@@ -304,6 +309,10 @@ run_test() { # testfile
# Main loop
for t in $TEST_CASES; do
run_test $t
+ if [ $STOP_FAILURE -ne 0 -a $TOTAL_RESULT -ne 0 ]; then
+ echo "A failure detected. Stop test."
+ exit 1
+ fi
done
# Test on instance loop
@@ -315,6 +324,10 @@ for t in $TEST_CASES; do
run_test $t
rmdir $TRACING_DIR
TRACING_DIR=$SAVED_TRACING_DIR
+ if [ $STOP_FAILURE -ne 0 -a $TOTAL_RESULT -ne 0 ]; then
+ echo "A failure detected. Stop test."
+ exit 1
+ fi
done
prlog ""