ftracetest: Add ftrace basic testcases
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Mon, 22 Sep 2014 23:42:52 +0000 (23:42 +0000)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 23 Sep 2014 13:32:00 +0000 (09:32 -0400)
Add ftrace basic testcases. This just checks ftrace debugfs
interface works as it is designed.

Link: http://lkml.kernel.org/p/20140922234252.23415.62897.stgit@kbuild-f20.novalocal
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/selftests/ftrace/test.d/00basic/basic1.tc [new file with mode: 0644]
tools/testing/selftests/ftrace/test.d/00basic/basic2.tc [new file with mode: 0644]
tools/testing/selftests/ftrace/test.d/00basic/basic3.tc [new file with mode: 0644]

diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic1.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic1.tc
new file mode 100644 (file)
index 0000000..9980ff1
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+# description: Basic trace file check
+test -f README -a -f trace -a -f tracing_on -a -f trace_pipe
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc
new file mode 100644 (file)
index 0000000..b04f30d
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+# description: Basic test for tracers
+for t in `cat available_tracers`; do
+  echo $t > current_tracer || exit 1
+done
+echo nop > current_tracer
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc
new file mode 100644 (file)
index 0000000..0c1a3a2
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# description: Basic trace clock test
+[ -f trace_clock ] || exit 1
+for c in `cat trace_clock | tr  -d \[\]`; do
+  echo $c > trace_clock || exit 1
+  grep '\['$c'\]' trace_clock || exit 1
+done
+echo local > trace_clock