]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Add interrupt information to dump of data sub-buffer
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 19 Dec 2023 12:45:42 +0000 (07:45 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 19 Dec 2023 12:49:22 +0000 (07:49 -0500)
commitd40dbb617ae9a8fe57343b26b4ad2bd7bb05c130
treedf22a1fb123867bb4abe2cc32bdf1ceddca6d98a
parentc84897c0ff5925090af0c6a8bf61424b71481764
ring-buffer: Add interrupt information to dump of data sub-buffer

When the ring buffer timestamp verifier triggers, it dumps the content of
the sub-buffer. But currently it only dumps the timestamps and the offset
of the data as well as the deltas. It would be even more informative if
the event data also showed the interrupt context level it was in.

That is, if each event showed that the event was written in normal,
softirq, irq or NMI context. Then a better idea about how the events may
have been interrupted from each other.

As the payload of the ring buffer is really a black box of the ring
buffer, just assume that if the payload is larger than a trace entry, that
it is a trace entry. As trace entries have the interrupt context
information saved in a flags field, look at that location and report the
output of the flags.

If the payload is not a trace entry, there's no way to really know, and
the information will be garbage. But that's OK, because this is for
debugging only (this output is not used in production as the buffer check
that calls it causes a huge overhead to the tracing). This information,
when available, is crucial for debugging timestamp issues. If it's
garbage, it will also be pretty obvious that its garbage too.

As this output usually happens in kselftests of the tracing code, the user
will know what the payload is at the time.

Link: https://lore.kernel.org/linux-trace-kernel/20231219074542.6f304601@gandalf.local.home
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c