]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing: Add guard(ring_buffer_nest)
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 1 Aug 2025 20:37:24 +0000 (16:37 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 1 Aug 2025 20:49:15 +0000 (16:49 -0400)
commit788fa4b47cdcd9b3d8c2d02ac0b3cd2540305f18
tree088626430dc7b4028c82066244c3a0e88c5f28c9
parentc89504a703fb779052213add0e8ed642f4a4f1c8
tracing: Add guard(ring_buffer_nest)

Some calls to the tracing ring buffer can happen when the ring buffer is
already being written to by the same context (for example, a
trace_printk() in between a ring_buffer_lock_reserve() and a
ring_buffer_unlock_commit()).

In order to not trigger the recursion detection, these functions use
ring_buffer_nest_start() and ring_buffer_nest_end(). Create a guard() for
these functions so that their use cases can be simplified and not need to
use goto for the release.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/20250801203857.710501021@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/ring_buffer.h
kernel/trace/trace.c
kernel/trace/trace_events_synth.c