Re: [PATCH 0/3] probes: Use trace_printk() in probe handlers

From
Steven Rostedt <rostedt@goodmis.org>
Date
2026-11-03 14:09:13
Also in
linux-doc, lkml
Reply to
Petr Mladek, 2026-11-03
On Tue, 3 Nov 2026 12:11:47 +0100
Petr Mladek [off-list ref] wrote:
I believe that trace_printk() has a similar problem. You could
not use it inside the code used by trace_printk() because
it might cause an unbound recursion.
That is slightly incorrect. I use trace_printk() to debug tracing! ;-)

Well, adding trace_printk() to the trace_printk() function itself will have
issues, but the ring buffer logic allows trace_printk() to be injected into
it. The ring buffer has recursion protection, so adding trace_printk() into
the ftrace ring buffer will print the trace_printk(). You may need to add a
way to not do the trace_printk() again, otherwise you may get multiple
prints until the nested limit is reached.

But I just wanted to point out that I do use trace_printk() to debug the
ring buffer even though trace_printk itself uses the ring buffer too.

-- Steve
Thread (11 messages) 11 messages, 4 authors, last reply 11d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help