summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/functions
diff options
context:
space:
mode:
authorXiao Yang <yangx.jy@cn.fujitsu.com>2020-04-22 11:58:07 +0200
committerShuah Khan <skhan@linuxfoundation.org>2020-04-24 01:11:37 +0200
commit16bcd0f509e469630d82a33a6d7e5d95bcc738fe (patch)
tree23b22cc21292d9b6f2290b2501be941551d425aa /tools/testing/selftests/ftrace/test.d/functions
parentselftests/ipc: Fix test failure seen after initial test run (diff)
downloadlinux-16bcd0f509e469630d82a33a6d7e5d95bcc738fe.tar.xz
linux-16bcd0f509e469630d82a33a6d7e5d95bcc738fe.zip
selftests/ftrace: Check required filter files before running test
Without CONFIG_DYNAMIC_FTRACE, some tests get failure because required filter files(set_ftrace_filter/available_filter_functions/stack_trace_filter) are missing. So implement check_filter_file() and make all related tests check required filter files by it. BTW: set_ftrace_filter and available_filter_functions are introduced together so just check either of them. Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/functions')
-rw-r--r--tools/testing/selftests/ftrace/test.d/functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 5d4550591ff9..61a3c7e2634d 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -1,3 +1,9 @@
+check_filter_file() { # check filter file introduced by dynamic ftrace
+ if [ ! -f "$1" ]; then
+ echo "$1 not found? Is dynamic ftrace not set?"
+ exit_unsupported
+ fi
+}
clear_trace() { # reset trace output
echo > trace