]> git.baikalelectronics.ru Git - kernel.git/commit
ftracetest: Fix hist unsupported result in hist selftests
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 23 May 2016 19:06:30 +0000 (15:06 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 20 Jun 2016 13:46:21 +0000 (09:46 -0400)
commit7285779f7ee5150c581e8b26ca50a360a23554c7
tree0422d908de6df2748eed4c3c4875f041cf1d9652
parentbb13f470717a7a708dbb8d925363205715842663
ftracetest: Fix hist unsupported result in hist selftests

When histograms are not configured in the kernel, the ftracetest histogram
selftests should return "unsupported" and not "Failed". To detect this, the
test scripts have:

 FEATURE=`grep hist events/sched/sched_process_fork/trigger`
 if [ -z "$FEATURE" ]; then
     echo "hist trigger is not supported"
     exit_unsupported
 fi

The problem is that '-e' is in effect and any error will cause the program
to terminate. The grep for 'hist' fails, because it is not compiled it (thus
unsupported), but because grep has an error code for failing to find the
string, it causes the program to terminate, and is marked as a failed test.

Namhyung Kim recommended to test for the "hist" file located in
events/sched/sched_process_fork/hist instead, as it is more inline with the
other checks. As the hist file is only created if the histogram feature is
enabled, that is a valid check.

Link: http://lkml.kernel.org/r/20160523151538.4ea9ce0c@gandalf.local.home
Suggested-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: d6de7b888278a ("kselftests/ftrace: Add hist trigger testcases")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc