]> git.ipfire.org Git - thirdparty/linux.git/commit
ring-buffer: Better comment the use of RB_MISSED_EVENTS
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 29 May 2026 02:37:38 +0000 (22:37 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 1 Jun 2026 00:34:05 +0000 (20:34 -0400)
commit4e8729e6598ba0d10021dbf48b308cd53a06bbc4
tree7e9a361d0091de439ae2cbe82076bf9ca590a3bd
parent8928e4a3be34bf053f9ef1cad67263604bf4f05e
ring-buffer: Better comment the use of RB_MISSED_EVENTS

If the persistent ring buffer is detected on boot up to have a corrupted
sub-buffer, that sub-buffer is cleared to zero and its commit value has
the RB_MISSED_EVENTS bit set. That bit is to allow the "trace",
"trace_pipe" and "trace_pipe_raw" files know that events were dropped by
outputting "[LOST EVENTS]".

Only in this case does that bit get set in the writeable portion of the
ring buffer. When events are dropped in the normal ring buffer, that
information is stored in the cpu_buffer descriptor and the
RB_MISSED_EVENTS is set in the buffer page at the time the page is
consumed. It is never set in the writeable portion of the buffer.

Add comments to describe this better as it can be confusing to know when
the RB_MISSED_EVENTS are set in the commit portion of the buffer page.

Link: https://lore.kernel.org/all/20260529001500.14178455a046a5cbc6180861@kernel.org/
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://patch.msgid.link/20260528223738.41276c0e@fedora
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c