diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2020-06-03 11:40:59 +0900 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-06-16 10:42:10 -0600 |
commit | 305c8388fd0c92f37ab766dbf864b7bea4b66f5f (patch) | |
tree | b00a40b0ee50de0d186d843f4307b805aef08511 /tools/testing/selftests/ftrace/test.d/functions | |
parent | 74e6072894d6ccd9c950d1c9bce3870596731810 (diff) | |
download | linux-stable-305c8388fd0c92f37ab766dbf864b7bea4b66f5f.tar.gz linux-stable-305c8388fd0c92f37ab766dbf864b7bea4b66f5f.tar.bz2 linux-stable-305c8388fd0c92f37ab766dbf864b7bea4b66f5f.zip |
selftests/ftrace: Support ":tracer" suffix for requires
Add ":tracer" suffix support for the requires list, so that
the testcase can list up the required tracer (e.g. function)
to the requires list.
For example, if the testcase requires function_graph tracer,
it can write requires list as below instead of checking
available_tracers.
# requires: function_graph:tracer
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Tom Zanussi <zanussi@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/functions | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions index cd2756c77ed9..35de6bc9613b 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -106,9 +106,15 @@ initialize_ftrace() { # Reset ftrace to initial-state enable_tracing } -check_requires() { # Check required files +check_requires() { # Check required files and tracers for i in $* ; do - if [ ! -e $i ]; then + t=${i%:tracer} + if [ $t != $i ]; then + if ! grep -wq $t available_tracers ; then + echo "Required tracer $t is not configured." + exit_unsupported + fi + elif [ ! -e $i ]; then echo "Required feature interface $i doesn't exist." exit_unsupported fi |