mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel.h: Add a never optimized away pr_dbg for printk(KERN_DEBUG pr_fmt(fmt)...)
@ 2009-10-14  2:56 Joe Perches
  2009-10-14  3:34 ` David Rientjes
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2009-10-14  2:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

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.

Signed-off-by: Joe Perches <joe@perches.com>

 include/linux/kernel.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4e3184..2ad0396 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -380,6 +380,8 @@ static inline char *pack_hex_byte(char *buf, u8
byte)
         printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_info(fmt, ...) \
         printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_dbg(fmt, ...) \
+        printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_cont(fmt, ...) \
 	printk(KERN_CONT fmt, ##__VA_ARGS__)
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-14  4:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14  2:56 [PATCH] kernel.h: Add a never optimized away pr_dbg for printk(KERN_DEBUG pr_fmt(fmt)...) Joe Perches
2009-10-14  3:34 ` David Rientjes
2009-10-14  4:21   ` Joe Perches
2009-10-14  4:28     ` David Rientjes
2009-10-14  4:44       ` Joe Perches

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®