linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Joe Perches <joe@perches.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	"jbaron@akamai.com" <jbaron@akamai.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	Nicolas Boichat <drinkcat@chromium.org>, kernel <kernel@axis.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"pmladek@suse.com" <pmladek@suse.com>,
	"sergey.senozhatsky@gmail.com" <sergey.senozhatsky@gmail.com>,
	"john.ogness@linutronix.de" <john.ogness@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] dynamic debug: allow printing to trace event
Date: Wed, 2 Sep 2020 14:17:19 +0200	[thread overview]
Message-ID: <20200902121719.ppj7nyzk2qic5dnq@axis.com> (raw)
In-Reply-To: <9bfb4c4bd1415a8ce527a913730672508a8e8330.camel@perches.com>

On Wed, Aug 26, 2020 at 09:53:57PM +0200, Joe Perches wrote:
> On Wed, 2020-08-26 at 15:32 -0400, Steven Rostedt wrote:
> > On Tue, 25 Aug 2020 08:53:25 -0700
> > Joe Perches <joe@perches.com> wrote:
> > 
> > > > The print buffer is statically allocated and managed using code borrowed
> > > > from __ftrace_trace_stack() and is limited to 256 bytes (four of these
> > > > are allocated per CPU to handle the various contexts); anything larger
> > > > will be truncated.  
> > > 
> > > There is an effort to avoid using trace_printk and the like
> > > so perhaps this feature should have the same compile time
> > > guard.
> > 
> > No, this is fine for being in a production kernel. Basically, these are
> > simply debug printk()s that can also be put into the trace buffer. The
> > key difference to trace_printk() is that they are an event that needs
> > to be enabled to write into the buffer.
> 
> It just seems like a backdoor way to convert various pr_debug functions
> (dev_dbg/netdev_dbg, et al) into tracing.
> 
> What's the real value?  Timing data?  Something else?

I mentioned my use case for this in the commit message and why it works
much better than printk() for that, please let me know if it is unclear:

 When debugging device drivers, I've found it very useful to be able to
 redirect existing pr_debug()/dev_dbg() prints to the trace buffer
 instead of dmesg.  Among the many advantages of the trace buffer is that
 it can be dynamically resized, allows these prints to combined with
 other trace events, and doesn't fill up system logs.

This is my only use case for this, and I've used it very very often
during the years I've been carrying this patch locally.

  reply	other threads:[~2020-09-02 12:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 15:33 [PATCH v3 0/2] Dynamic debug trace support Vincent Whitchurch
2020-08-25 15:33 ` [PATCH v3 1/2] dynamic debug: split enable and printk flags Vincent Whitchurch
2020-08-25 15:33 ` [PATCH v3 2/2] dynamic debug: allow printing to trace event Vincent Whitchurch
2020-08-25 15:53   ` Joe Perches
2020-08-26 19:32     ` Steven Rostedt
2020-08-26 19:53       ` Joe Perches
2020-09-02 12:17         ` Vincent Whitchurch [this message]
2023-12-26 16:57         ` Guilherme G. Piccoli
2023-12-27  8:29           ` Vincent Whitchurch
2023-12-27 13:06             ` Guilherme G. Piccoli

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=20200902121719.ppj7nyzk2qic5dnq@axis.com \
    --to=vincent.whitchurch@axis.com \
    --cc=corbet@lwn.net \
    --cc=drinkcat@chromium.org \
    --cc=jbaron@akamai.com \
    --cc=joe@perches.com \
    --cc=john.ogness@linutronix.de \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).