Skip to contentSkip to conversation

selftests/ftrace: Return unsupported if no error_log file

PATCH In review Masami Hiramatsu 2 participants 2 messages May 25, 2020 – May 28, 2020

Subsystems (2)
lore
Share & tools
lore

Masami Hiramatsu

author maintainer
#0 lore raw

PATCH 1/1 selftests/ftrace: Return unsupported if no error_log file

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")
---
 .../ftrace/test.d/ftrace/tracing-error-log.tc      |    2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc +2 -0
index 021c03fd885d..23465823532b 100644
@@ -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
maintainer
#1 lore raw
Quoted 19 lines · Masami Hiramatsu

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")
---
  .../ftrace/test.d/ftrace/tracing-error-log.tc      |    2 ++
  1 file changed, 2 insertions(+)
tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc +0 -0
index 021c03fd885d..23465823532b 100644

tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc if [ ! -f set_event ]; then · line 21

Quoted 8 lines
tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc +2 -0
@@ -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

Applied to

git.kernel.org/pub/scm/linux/kernel/git/shuah/linux kselftest.git/ next branch for Linux 5.8-rc1

thanks,
-- Shuah