Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20141103212737.696365174@goodmis.org
Link: http://lkml.kernel.org/r/20141104153028.465517119@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>

+19
+3
tools/testing/selftests/ftrace/ftracetest
··· 235 235 fi 236 236 } 237 237 238 + # load in the helper functions 239 + . $TEST_DIR/functions 240 + 238 241 # Main loop 239 242 for t in $TEST_CASES; do 240 243 run_test $t
+16
tools/testing/selftests/ftrace/test.d/functions
··· 1 + 2 + clear_trace() { # reset trace output 3 + echo > trace 4 + } 5 + 6 + disable_tracing() { # stop trace recording 7 + echo 0 > tracing_on 8 + } 9 + 10 + enable_tracing() { # start trace recording 11 + echo 1 > tracing_on 12 + } 13 + 14 + reset_tracer() { # reset the current tracer 15 + echo nop > current_tracer 16 + }