summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPo-Hsu Lin <po-hsu.lin@canonical.com>2020-05-05 12:14:45 +0200
committerShuah Khan <skhan@linuxfoundation.org>2020-05-08 17:43:30 +0200
commitadb571649c7ce7ee16022fa302b62043d1812b4b (patch)
treec3f85f089b888788240156b16e9009c4f9d56029 /tools
parenttools/testing: Replace zero-length array with flexible-array (diff)
downloadlinux-adb571649c7ce7ee16022fa302b62043d1812b4b.tar.xz
linux-adb571649c7ce7ee16022fa302b62043d1812b4b.zip
selftests/ftrace: mark irqsoff_tracer.tc test as unresolved if the test module does not exist
The UNRESOLVED state is much more apporiate than the UNSUPPORTED state for the absence of the test module, as it matches "test was set up incorrectly" situation in the README file. A possible scenario is that the function was enabled (supported by the kernel) but the module was not installed properly, in this case we cannot call this as UNSUPPORTED. This change also make it consistent with other module-related tests in ftrace. Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
index cbd174334a48..2b82c80edf69 100644
--- a/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
+++ b/tools/testing/selftests/ftrace/test.d/preemptirq/irqsoff_tracer.tc
@@ -17,7 +17,14 @@ unsup() { #msg
exit_unsupported
}
-modprobe $MOD || unsup "$MOD module not available"
+unres() { #msg
+ reset_tracer
+ rmmod $MOD || true
+ echo $1
+ exit_unresolved
+}
+
+modprobe $MOD || unres "$MOD module not available"
rmmod $MOD
grep -q "preemptoff" available_tracers || unsup "preemptoff tracer not enabled"