From: David Rientjes <rientjes@google.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel.h: Add a never optimized away pr_dbg for printk(KERN_DEBUG pr_fmt(fmt)...)
Date: Tue, 13 Oct 2009 20:34:11 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.1.00.0910132031040.1244@chino.kir.corp.google.com> (raw)
In-Reply-To: <1255488982.1909.26.camel@Joe-Laptop.home>
On Tue, 13 Oct 2009, Joe Perches wrote:
> Many developers use a logging message that
> is printed at KERN_DEBUG level that is always
> printed regardless of #define DEBUG levels.
>
> pr_debug can be optimized away to a null statement.
>
> Add a pr_dbg message that prints at KERN_DEBUG
> level that uses pr_fmt() that can not be optimized
> to nothing.
>
pr_dbg() is horribly misnamed, it doesn't indicate why it exists vs.
pr_debug() at all. Future users will undoubtedly use it by mistake when
they only really mean for the message to be emitted on DEBUG because
they've seen it in other places and haven't checked the implementation.
I'd suggest pr_debug_force(), even though it's much longer (although still
shorter than printk(KERN_DEBUG)).
next prev parent reply other threads:[~2009-10-14 3:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 2:56 Joe Perches
2009-10-14 3:34 ` David Rientjes [this message]
2009-10-14 4:21 ` Joe Perches
2009-10-14 4:28 ` David Rientjes
2009-10-14 4:44 ` Joe Perches
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=alpine.DEB.1.00.0910132031040.1244@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®