Re: [for-next][PATCH 16/31] tracing: Add tracer_tracing_disable/enable() functions

From: Doug Anderson
Date: Fri May 09 2025 - 11:49:42 EST


Hi,

On Fri, May 9, 2025 at 6:13 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> Allow a tracer to disable writing to its buffer for a temporary amount of
> time and re-enable it.
>
> The tracer_tracing_disable() will disable writing to the trace array
> buffer, and requires a tracer_tracing_enable() to re-enable it.
>
> The difference between tracer_tracing_disable() and tracer_tracing_off()
> is that the disable version can nest, and requires as many enable() calls
> as disable() calls to re-enable the buffer. Where as the off() function
> can be called multiple times and only requires a singe tracer_tracing_on()
> to re-enable the buffer.
>
> Cc: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
> Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Daniel Thompson <danielt@xxxxxxxxxx>
> Cc: Douglas Anderson <dianders@xxxxxxxxxxxx>
> Link: https://lore.kernel.org/20250505212235.210330010@xxxxxxxxxxx
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> ---
> kernel/trace/trace.c | 33 +++++++++++++++++++++++++++++++++
> kernel/trace/trace.h | 2 ++
> 2 files changed, 35 insertions(+)

I'm not deeply familiar with the tracing system internals, but it
seems reasonable to me.

Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>