public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Roland McGrath <roland@redhat.com>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk.caller
Date: Fri, 03 Oct 2008 12:40:41 +0200	[thread overview]
Message-ID: <1223030441.28938.11.camel@twins> (raw)
In-Reply-To: <20081002163154.fd5f2a10.akpm@linux-foundation.org>

On Thu, 2008-10-02 at 16:31 -0700, Andrew Morton wrote:
> On Thu,  2 Oct 2008 16:21:15 -0700 (PDT)
> Roland McGrath <roland@redhat.com> wrote:
> 
> > This adds the printk.caller=[0|1] boot parameter, default setting
> > controlled by CONFIG_PRINTK_CALLER.  (This is modelled on printk.time
> > and CONFIG_PRINTK_TIME.)
> > 
> > When this is set, each printk line is automagically prefixed with
> > "{0x123abc} " giving the PC address of that printk call (actually
> > the PC address just after the call).
> > 
> > As a kernel hacker, I always hate having to grep for some fragment
> > of a message to find the code that generated it.  But I always have
> > my -g vmlinux handy, so:
> > 	(gdb) info line *(0x123abc - 1)
> > is real handy (it pops the source up in an Emacs buffer).
> > 
> 
> hm.  What do others think?

git grep is usually plenty fast for me, but I guess different people,
different tastes.

Also, I always use addr2line instead of gdb,.. another not-to-the-point
difference ;-)

The only real downside to this patch for me is that it potentially
increases the length of lines which means I;d have to stretch my serial
console window, but I guess others might object to the puny increase in
object size.

Flip a coin.

One tiny nit though:

> +                               char pbuf[sizeof caller * 2 + sizeof "{0x} "];

I thought we did sizeof() in-kernel.


      parent reply	other threads:[~2008-10-03 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 23:21 [PATCH] printk.caller Roland McGrath
2008-10-02 23:31 ` Andrew Morton
2008-10-02 23:43   ` Roland McGrath
2008-10-03 10:40   ` Peter Zijlstra [this message]

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=1223030441.28938.11.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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