[for-next][PATCH 05/17] selftests: ftrace: Check whether snapshot trigger is supported correctly
From: Steven Rostedt
Date: Wed Nov 23 2016 - 10:35:40 EST
From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
If "snapshot" special file doesn't exist, that kernel does
not support snapshot and snapshot trigger too. In that case
snapshot trigger test results to unsupported instead of fail.
Link: 147928401215.22982.10411665829041109794.stgit@devbox">http://lkml.kernel.org/r/147928401215.22982.10411665829041109794.stgit@devbox
Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
index f84b80d551a2..ed94f0c4e0e4 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
@@ -23,6 +23,11 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
exit_unsupported
fi
+if [ ! -f snapshot ]; then
+ echo "snapshot is not supported"
+ exit_unsupported
+fi
+
reset_tracer
do_reset
--
2.10.2