lkml.org 
[lkml]   [2004]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk loglevel policy?
Coywolf Qi Hunt wrote:
> Hi all,
>
> Recently, I've seen a lot of add loglevel to printk patches.
> grep 'printk("' -r | wc shows me 2433. There are probably 2433 printk
> need to patch, is it? What's this printk loglevel policy, all these
> printk calls need loglevel adjusted? The default loglevel is
> KERN_WARNING.
>
>
> --coywolf

Not every printk() needs a loglevel. For example:

printk (KERN_WARN "blah...");

some stuff...

printk ("bleh...");

more stuff...

printk ("done\n");

is used in a lot of areas.

You'll also see:
#ifdef VERBOSE_DEBUG
#define FOO_DEBUG(a, b) printk ("%s: %s\n", a, b)
#else
#define FOO_DEBUG(a, b)
#endif

which is normally only used for debug builds.

The logging levels are, for the most part, common sense. KERN_ERR for error
conditions, KERN_INFO for informational (i. e. "driver just loaded", "new disk
detected"), KERN_CRIT if your computer just caught on fire (!), and KERN_DEBUG for
any kind of verbose printing.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [from the cache]
©2003-2011 Jasper Spaans