Re: printk loglevel policy?

From: Jim Nelson
Date: Thu Dec 30 2004 - 23:09:13 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/