On Tue, 3 Nov 2026 09:09:01 -0500, Steven Rostedt [off-list ref] wrote:
On Tue, 3 Nov 2026 12:11:47 +0100
Petr Mladek [off-list ref] wrote:
quoted
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.
Yes, so for short term solution to fix the problem, I would like to use
trace_printk() until we ensure to check the printk is safe. After removing
legacy console driver (or introducing a Kconfig to ensure no legacy driver)
I will revisit this.
Thank you,
-- Steve
--
Masami Hiramatsu (Google) [off-list ref]