# Re: \[PATCH 0/3\] probes: Use trace\_printk() in probe handlers

- From: Steven Rostedt \<rostedt@goodmis.org\>
- Date: 2026-11-03 14:09:13 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/11/17853185
- Thread: https://ratatoskr.run/linux-trace-kernel/2026/11/17842060/t.md

```text
On Tue, 3 Nov 2026 12:11:47 +0100
Petr Mladek [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
```
