public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] kernel.h: Add pr_debug_noopt
@ 2009-10-01 19:12 Joe Perches
  2009-10-01 19:44 ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2009-10-01 19:12 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton

Many times a developer always wants to emit a KERN_DEBUG level
logging message even if DEBUG is not defined.

These messages today do not have a "pr_<level>" equivalent
and must be coded with printk(KERN_DEBUG.

This means that pr_fmt is not used with these logging messages.

I propose a new shortcut #define pr_<level> be added to kernel.h
to handle these KERN_DEBUG cases not prefixed with pr_fmt.

I'm not happy with the name.  Some good alternatives are
already in use in a couple of places.

pr_dbg is #defined in drivers/char/isicom.c
pr_vdebug is #defined in drivers/usb/gadget/u_serial.c

I think it's appropriate to remove and substitute one
or both of these #defines from the files in drivers
and use one or both in kernel.h

Suggestions?

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d3cd23f..f1f53b9 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_debug_noopt(fmt, ...) \
+	printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_cont(fmt, ...) \
 	printk(KERN_CONT fmt, ##__VA_ARGS__)
 



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

* Re: [RFC PATCH] kernel.h: Add pr_debug_noopt
  2009-10-01 19:12 [RFC PATCH] kernel.h: Add pr_debug_noopt Joe Perches
@ 2009-10-01 19:44 ` David Daney
  2009-10-01 19:57   ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2009-10-01 19:44 UTC (permalink / raw)
  To: Joe Perches; +Cc: LKML, Andrew Morton

Joe Perches wrote:
> Many times a developer always wants to emit a KERN_DEBUG level
> logging message even if DEBUG is not defined.
> 
> These messages today do not have a "pr_<level>" equivalent
> and must be coded with printk(KERN_DEBUG.
> 
> This means that pr_fmt is not used with these logging messages.
> 
> I propose a new shortcut #define pr_<level> be added to kernel.h
> to handle these KERN_DEBUG cases not prefixed with pr_fmt.
> 
> I'm not happy with the name.  Some good alternatives are
> already in use in a couple of places.
> 
> pr_dbg is #defined in drivers/char/isicom.c
> pr_vdebug is #defined in drivers/usb/gadget/u_serial.c
> 
> I think it's appropriate to remove and substitute one
> or both of these #defines from the files in drivers
> and use one or both in kernel.h
> 
> Suggestions?
> 
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index d3cd23f..f1f53b9 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_debug_noopt(fmt, ...) \
> +	printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)


To me, 'noopt' is too much like 'nop'.

How about 'mand' or 'ungated' or something similar?

In general I like the concept.

David Daney

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

* Re: [RFC PATCH] kernel.h: Add pr_debug_noopt
  2009-10-01 19:44 ` David Daney
@ 2009-10-01 19:57   ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2009-10-01 19:57 UTC (permalink / raw)
  To: David Daney; +Cc: LKML, Andrew Morton

On Thu, 2009-10-01 at 12:44 -0700, David Daney wrote:
> Joe Perches wrote:
> > --- 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_debug_noopt(fmt, ...) \
> > +	printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

> To me, 'noopt' is too much like 'nop'.

noopt is not ideal.  I'd prefer pr_dbg.

> How about 'mand' or 'ungated' or something similar?

Maybe pr_debug_always which is just 1 letter longer



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

end of thread, other threads:[~2009-10-01 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 19:12 [RFC PATCH] kernel.h: Add pr_debug_noopt Joe Perches
2009-10-01 19:44 ` David Daney
2009-10-01 19:57   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox