Skip to content

Commit 8684f2f

Browse files
committed
selftests/ftrace: Fix check of return value in fgraph-retval.tc test
The addition of recording both the function name and return address to the function graph tracer updated the selftest to check for "=-5" from "= -5". But this causes the test to fail on certain configs, as "= -5" is still a value that can be returned if function addresses are not enabled (older kernels). Check for both "=-5" and " -5" as a success value. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Donglin Peng <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 21e9280 ("function_graph: Support recording and printing the function return address") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0b58261 commit 8684f2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-retval.tc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set -e
2929

3030
: "Test printing the error code in signed decimal format"
3131
echo 0 > options/funcgraph-retval-hex
32-
count=`cat trace | grep 'proc_reg_write' | grep '=-5' | wc -l`
32+
count=`cat trace | grep 'proc_reg_write' | grep -e '=-5 ' -e '= -5 ' | wc -l`
3333
if [ $count -eq 0 ]; then
3434
fail "Return value can not be printed in signed decimal format"
3535
fi

0 commit comments

Comments
 (0)