Skip to content

Commit 25b9513

Browse files
mhiramatrostedt
authored andcommitted
selftests/ftrace: Stop tracing while reading the trace file by default
Stop tracing while reading the trace file by default, to prevent the test results while checking it and to avoid taking a long time to check the result. If there is any testcase which wants to test the tracing while reading the trace file, please override this setting inside the test case. This also recovers the pause-on-trace when clean it up. Link: https://lkml.kernel.org/r/163529053143.690749.15365238954175942026.stgit@devnote2 Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 5c03d8f commit 25b9513

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tools/testing/selftests/ftrace/ftracetest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ for t in $TEST_CASES; do
428428
exit 1
429429
fi
430430
done
431-
(cd $TRACING_DIR; initialize_ftrace) # for cleanup
431+
(cd $TRACING_DIR; finish_ftrace) # for cleanup
432432

433433
prlog ""
434434
prlog "# of passed: " `echo $PASSED_CASES | wc -w`

tools/testing/selftests/ftrace/test.d/functions

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,22 @@ initialize_ftrace() { # Reset ftrace to initial-state
124124
[ -f uprobe_events ] && echo > uprobe_events
125125
[ -f synthetic_events ] && echo > synthetic_events
126126
[ -f snapshot ] && echo 0 > snapshot
127+
128+
# Stop tracing while reading the trace file by default, to prevent
129+
# the test results while checking it and to avoid taking a long time
130+
# to check the result.
131+
[ -f options/pause-on-trace ] && echo 1 > options/pause-on-trace
132+
127133
clear_trace
128134
enable_tracing
129135
}
130136

137+
finish_ftrace() {
138+
initialize_ftrace
139+
# And recover it to default.
140+
[ -f options/pause-on-trace ] && echo 0 > options/pause-on-trace
141+
}
142+
131143
check_requires() { # Check required files and tracers
132144
for i in "$@" ; do
133145
r=${i%:README}

0 commit comments

Comments
 (0)