aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-13 01:08:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-18 18:49:50 -0400
commitaebdc3b450a3febf7d7d00cd2235509055ec7082 (patch)
tree3e9d53857d610d2b7eab3e2cce3cae2220202f52 /include
parentbc37e2830339cbfa42ac8579a7bf62fc4cdd360d (diff)
dev_vdbg(), available with -DVERBOSE_DEBUG
This defines a dev_vdbg() call, which is enabled with -DVERBOSE_DEBUG. When enabled, dev_vdbg() acts just like dev_dbg(). When disabled, it is a NOP ... just like dev_dbg() without -DDEBUG. The specific code was moved out of a USB patch, but lots of drivers have similar support. That is, code can now be written to use an additional level of debug output, selected at compile time. Many driver authors have found this idiom to be very useful. A typical usage model is for "normal" debug messages to focus on fault paths and not be very "chatty", so that those messages can be left on during normal operation without much of a performance or syslog load. On the other hand "verbose" messages would be noisy enough that they wouldn't normally be enabled; they might even affect timings enough to change system or driver behavior. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index be2debed70d2..d9f0a57f5a2f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -572,6 +572,16 @@ dev_dbg(struct device * dev, const char * fmt, ...)
572} 572}
573#endif 573#endif
574 574
575#ifdef VERBOSE_DEBUG
576#define dev_vdbg dev_dbg
577#else
578static inline int __attribute__ ((format (printf, 2, 3)))
579dev_vdbg(struct device * dev, const char * fmt, ...)
580{
581 return 0;
582}
583#endif
584
575#define dev_err(dev, format, arg...) \ 585#define dev_err(dev, format, arg...) \
576 dev_printk(KERN_ERR , dev , format , ## arg) 586 dev_printk(KERN_ERR , dev , format , ## arg)
577#define dev_info(dev, format, arg...) \ 587#define dev_info(dev, format, arg...) \