diff mbox series

selftests/ftrace: Stop tracing before searching non-exist event entry

Message ID 163278786632.187921.7275187717663096458.stgit@devnote2
State New
Headers show
Series selftests/ftrace: Stop tracing before searching non-exist event entry | expand

Commit Message

Masami Hiramatsu (Google) Sept. 28, 2021, 12:11 a.m. UTC
Stop tracing before searching the pattern which is expected to
not exist on the trace buffer. In some case, it will take too
long and may not come back eternally because while searching
the tracing data will be increased by the searching activity.

I found this with enabling kernel debug options, like kmemleak,
lockdep etc. and run it on qemu with 2 CPUs. It did not come
back in 20 minutes and finally I need to interrupt it to stop.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>

---
 .../ftrace/test.d/ftrace/func_profiler.tc          |    3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
index 1dbd766c0cd2..440f4d87aa4b 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
@@ -56,6 +56,9 @@  clear_trace
 sleep 1
 
 echo "make sure something other than scheduler is being traced"
+
+echo 0 > tracing_on
+
 if ! grep -v -e '^#' -e 'schedule' trace > /dev/null; then
 	cat trace
 	fail "no other functions besides schedule was found"