selftests/ftrace: Return unsupported if no error_log file
authorMasami Hiramatsu <mhiramat@kernel.org>
Mon, 25 May 2020 10:20:57 +0000 (19:20 +0900)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 28 May 2020 16:14:52 +0000 (10:14 -0600)
Check whether error_log file exists in tracing/error_log testcase
and return UNSUPPORTED if no error_log file.

This can happen if we run the ftracetest on the older stable
kernel.

Fixes: 4eab1cc461a6 ("selftests/ftrace: Add tracing/error_log testcase")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc

index 021c03fd885db036a6a0300c56408ecca98edfe1..23465823532b9c91e7d21e5be03d68bf1a68860d 100644 (file)
@@ -14,6 +14,8 @@ if [ ! -f set_event ]; then
     exit_unsupported
 fi
 
+[ -f error_log ] || exit_unsupported
+
 ftrace_errlog_check 'event filter parse error' '((sig >= 10 && sig < 15) || dsig ^== 17) && comm != bash' 'events/signal/signal_generate/filter'
 
 exit 0