aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <[email protected]>2014-11-03 15:36:35 -0500
committerSteven Rostedt <[email protected]>2014-11-06 08:30:02 -0500
commitee3988c77e37896b0576ba01a793698add13d6f5 (patch)
tree3de45f870ff718bcbac6fbaaa772754d3b66870b
parent52100d7f1c35e5b8c4f3017d36f378372f67f87d (diff)
ftracetest: Add functions file that holds helper functions
Created the file tools/testing/ftrace/test.d/functions that will hold helper functions. Current helper functions include: Add clear_trace() helper to reset the trace file Used as a descriptive name to show that "echo > trace" is clearing the trace file. Add disable/enable_tracing() helper calls Add calls that disable and enable tracing respectively by echoing 0 or 1 into tracing_on. Add helper reset_tracer() function Add a helper function reset_tracer() that will clear the current_tracer (echo nop > current_tracer). Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Acked-by: Masami Hiramatsu <[email protected]> Acked-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
-rwxr-xr-xtools/testing/selftests/ftrace/ftracetest3
-rw-r--r--tools/testing/selftests/ftrace/test.d/functions16
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index f15c0da07aca..c6381a9faf83 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -235,6 +235,9 @@ run_test() { # testfile
fi
}
+# load in the helper functions
+. $TEST_DIR/functions
+
# Main loop
for t in $TEST_CASES; do
run_test $t
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
new file mode 100644
index 000000000000..5d8cd06d920f
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -0,0 +1,16 @@
+
+clear_trace() { # reset trace output
+ echo > trace
+}
+
+disable_tracing() { # stop trace recording
+ echo 0 > tracing_on
+}
+
+enable_tracing() { # start trace recording
+ echo 1 > tracing_on
+}
+
+reset_tracer() { # reset the current tracer
+ echo nop > current_tracer
+}