Re: [PATCH 2/7] CAN: Add PF_CAN core module

David Miller
2007-11-16T23:42:58Z

From: Urs Thuermann <urs.thuermann@gmx.de>
Date: 16 Nov 2007 15:33:08 +0100

> I am not aware of any useful kernel facilities to replace our debug
> macros, i.e. printing of debug messages, controlled by a bit mask
> passed in as a module parameter, hexdumping of fames, etc. Of course,
> there are other things like kprobes but sometimes printk(KERN_DEBUG...)
> is more convenient and that's why people write their own DBG() macros.

At the simplest level there is pr_debug() which replaces the
usual "print if DEBUG is defined" that lots of people use.

For device drivers we have something similar in dev_vdbg() et
al.

For bitmask based enabling yes it would be nice if there were
something more. But you can also get this behavior by using
DEBUG, the above interfaces, and adjusting the kernel log level
to suit what you're trying to view.