From linux-usb-devel-admin@lists.sourceforge.net Fri Feb 24 01:51:08 2006 Message-ID: <43FED6FC.3090604@imap.cc> From: Tilman Schmidt Cc: Subject: USB: reduce syslog clutter Date: Fri, 24 Feb 2006 10:50:52 +0100 The current versions of the err() / info() / warn() syslog macros insert __FILE__ at the beginning of the message, which expands to the complete path name of the source file within the kernel tree. With the following patch, when used in a module, they'll insert the module name instead, which is significantly shorter and also tends to be more useful to users trying to make sense of a particular message. Signed-off-by: Tilman Schmidt Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- gregkh-2.6.orig/include/linux/usb.h +++ gregkh-2.6/include/linux/usb.h @@ -1198,11 +1198,13 @@ extern void usb_unregister_notify(struct #endif #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ - __FILE__ , ## arg) + THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \ - __FILE__ , ## arg) + THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \ - __FILE__ , ## arg) + THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) +#define notice(format, arg...) printk(KERN_NOTICE "%s: " format "\n" , \ + THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) #endif /* __KERNEL__ */