linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/ftrace: Stop tracing before searching non-exist event entry
@ 2021-09-28  0:11 Masami Hiramatsu
  2021-10-13 22:16 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2021-09-28  0:11 UTC (permalink / raw)
  To: Steven Rostedt, Shuah Khan, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Masami Hiramatsu

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 --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"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/ftrace: Stop tracing before searching non-exist event entry
  2021-09-28  0:11 [PATCH] selftests/ftrace: Stop tracing before searching non-exist event entry Masami Hiramatsu
@ 2021-10-13 22:16 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-10-13 22:16 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Shuah Khan, Shuah Khan, linux-kselftest, linux-kernel

On Tue, 28 Sep 2021 09:11:06 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

I'm finally getting through my queue to see this.

> 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.

One other option is to bring back the old behavior:

  echo 1 > options/pause-on-trace

Which will stop tracing as the trace file is read.

But either way works for me.

-- Steve

> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  .../ftrace/test.d/ftrace/func_profiler.tc          |    3 +++
>  1 file changed, 3 insertions(+)
> 
> 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"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-13 22:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28  0:11 [PATCH] selftests/ftrace: Stop tracing before searching non-exist event entry Masami Hiramatsu
2021-10-13 22:16 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).