mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Petr Mladek <pmladek@suse.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	John Ogness <john.ogness@linutronix.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Naveen N Rao <naveen@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH 0/3] probes: Use trace_printk() in probe handlers
Date: Tue, 3 Nov 2026 09:09:01 -0500	[thread overview]
Message-ID: <20261103090901.0b5957e9@gandalf.local.home> (raw)
In-Reply-To: <aunBcxXXNhXDd-U5@pathway.suse.cz>

On Tue, 3 Nov 2026 12:11:47 +0100
Petr Mladek <pmladek@suse.com> 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

  reply	other threads:[~2026-11-03 14:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  7:10 Masami Hiramatsu (Google)
2026-11-02  7:11 ` [PATCH 1/3] samples/kprobes: " Masami Hiramatsu (Google)
2026-11-02  7:11 ` [PATCH 2/3] samples/fprobe: Use trace_printk() and trace_dump_stack() Masami Hiramatsu (Google)
2026-11-02  7:11 ` [PATCH 3/3] docs: trace: Warn against using printk() in probe handlers Masami Hiramatsu (Google)
2026-11-02 17:34 ` [PATCH 0/3] probes: Use trace_printk() " Steven Rostedt
2026-11-02 22:01   ` John Ogness
2026-11-03  2:06     ` Masami Hiramatsu (Google)
2026-11-03 11:11       ` Petr Mladek
2026-11-03 14:09         ` Steven Rostedt [this message]
2026-11-05 15:40           ` Masami Hiramatsu (Google)
2026-11-05 15:48         ` Masami Hiramatsu (Google)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261103090901.0b5957e9@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=john.ogness@linutronix.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=naveen@kernel.org \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®