summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-09-23 17:33:36 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-11-06 08:35:52 -0500
commitc6c93242db95371d976cf9b5ff9e614c71f75a70 (patch)
treee0f44cd70676ac8243e1a945016b68bf0195b782 /tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
parentee3988c77e37896b0576ba01a793698add13d6f5 (diff)
ftracetest: Add a couple of ftrace test cases
Added three test cases to get the feel of adding tests to ftracetest. The three cases are: function profiling test, to make sure function profiling still works with function tracing (was a regression) function graph filter test to make sure that function graph filtering works. function graph filter with stack tracing test to make sure that the function graph filter does filter and also continues to filter when another function tracer is running (like the stack tracer) Link: http://lkml.kernel.org/r/20141103212737.696365174@goodmis.org Link: http://lkml.kernel.org/r/20141104153028.602754370@goodmis.org Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc')
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc52
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
new file mode 100644
index 000000000000..6af5f6360b18
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
@@ -0,0 +1,52 @@
+#!/bin/sh
+# description: ftrace - function graph filters
+
+# Make sure that function graph filtering works
+
+if ! grep -q function_graph available_tracers; then
+ echo "no function graph tracer configured"
+ exit_unsupported
+fi
+
+do_reset() {
+ reset_tracer
+ enable_tracing
+ clear_trace
+}
+
+fail() { # msg
+ do_reset
+ echo $1
+ exit -1
+}
+
+disable_tracing
+clear_trace
+
+# filter something, schedule is always good
+if ! echo "schedule" > set_ftrace_filter; then
+ # test for powerpc 64
+ if ! echo ".schedule" > set_ftrace_filter; then
+ fail "can not enable schedule filter"
+ fi
+fi
+
+echo function_graph > current_tracer
+enable_tracing
+sleep 1
+# search for functions (has "()" on the line), and make sure
+# that only the schedule function was found
+count=`cat trace | grep '()' | grep -v schedule | wc -l`
+if [ $count -ne 0 ]; then
+ fail "Graph filtering not working by itself?"
+fi
+
+# Make sure we did find something
+count=`cat trace | grep 'schedule()' | wc -l`
+if [ $count -eq 0 ]; then
+ fail "No schedule traces found?"
+fi
+
+do_reset
+
+exit 0