Skip to content

Commit b730d66

Browse files
alan-maguireshuahkh
authored andcommitted
ftrace/selftest: make unresolved cases cause failure if --fail-unresolved set
Currently, ftracetest will return 1 (failure) if any unresolved cases are encountered. The unresolved status results from modules and programs not being available, and as such does not indicate any issues with ftrace itself. As such, change the behaviour of ftracetest in line with unsupported cases; if unsupported cases happen, ftracetest still returns 0 unless --fail-unsupported. Here --fail-unresolved is added and the default is to return 0 if unresolved results occur. Signed-off-by: Alan Maguire <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 57c4cfd commit b730d66

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/testing/selftests/ftrace/ftracetest

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ echo " -v|--verbose Increase verbosity of test messages"
1717
echo " -vv Alias of -v -v (Show all results in stdout)"
1818
echo " -vvv Alias of -v -v -v (Show all commands immediately)"
1919
echo " --fail-unsupported Treat UNSUPPORTED as a failure"
20+
echo " --fail-unresolved Treat UNRESOLVED as a failure"
2021
echo " -d|--debug Debug mode (trace all shell commands)"
2122
echo " -l|--logdir <dir> Save logs on the <dir>"
2223
echo " If <dir> is -, all logs output in console only"
@@ -112,6 +113,10 @@ parse_opts() { # opts
112113
UNSUPPORTED_RESULT=1
113114
shift 1
114115
;;
116+
--fail-unresolved)
117+
UNRESOLVED_RESULT=1
118+
shift 1
119+
;;
115120
--logdir|-l)
116121
LOG_DIR=$2
117122
shift 2
@@ -176,6 +181,7 @@ KEEP_LOG=0
176181
DEBUG=0
177182
VERBOSE=0
178183
UNSUPPORTED_RESULT=0
184+
UNRESOLVED_RESULT=0
179185
STOP_FAILURE=0
180186
# Parse command-line options
181187
parse_opts $*
@@ -280,7 +286,7 @@ eval_result() { # sigval
280286
$UNRESOLVED)
281287
prlog " [${color_blue}UNRESOLVED${color_reset}]"
282288
UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO"
283-
return 1 # this is a kind of bug.. something happened.
289+
return $UNRESOLVED_RESULT # depends on use case
284290
;;
285291
$UNTESTED)
286292
prlog " [${color_blue}UNTESTED${color_reset}]"

0 commit comments

Comments
 (0)