lkml.org 
[lkml]   [2009]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel.h: Add a never optimized away pr_dbg for printk(KERN_DEBUG pr_fmt(fmt)...)
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)).


\
 
 \ /
  Last update: 2009-10-14 05:37    [W:0.063 / U:16.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site