All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG and WARN kernel log levels
@ 2016-08-15 18:53 Kees Cook
  2016-08-15 19:00 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2016-08-15 18:53 UTC (permalink / raw)
  To: Joe Perches; +Cc: LKML

Hi,

So, I noticed that asm-gemeric/bug.h defines BUG() without a log level:

#ifndef HAVE_ARCH_BUG
#define BUG() do { \
       printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \

Seems like it should have one?

Also, I think we might want to examine WARN() a bit... it doesn't have
a log level either, but only a fraction of callers set one:

$ git grep -E 'WARN(_TAINT|)(_RATELIMIT|_ONCE|)\([^\)]' | grep -v KERN_ | wc -l
2735

$ git grep -E 'WARN(_TAINT|)(_RATELIMIT|_ONCE|)\([^\)]' | grep KERN_ | wc -l
77

If I'm reading checkpatch.pl correctly, it doesn't warn about missing
log levels on WARN calls, but I think it should.

How do you think is best to clean this up?

Mainly, I'd like to add a format string to BUG, or introduce a new
BUGish call that takes a format...

-Kees

-- 
Kees Cook
Nexus Security

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

end of thread, other threads:[~2016-08-17 22:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-15 18:53 BUG and WARN kernel log levels Kees Cook
2016-08-15 19:00 ` Joe Perches
2016-08-15 20:28   ` Kees Cook
2016-08-15 20:39     ` Joe Perches
2016-08-17 16:36   ` Joe Perches
2016-08-17 21:19     ` Kees Cook
2016-08-17 22:49       ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.