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 <[email protected]> --- usb.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -ru linux-2.6.16-rc4-mm1-orig/include/linux/usb.h linux-2.6.16-rc4-patch-splitpoint/include/linux/usb.h --- linux-2.6.16-rc4-mm1-orig/include/linux/usb.h 2006-02-22 12:04:07.000000000 +0100 +++ linux-2.6.16-rc4-patch-splitpoint/include/linux/usb.h 2006-02-24 10:37:53.000000000 +0100 @@ -1211,11 +1211,11 @@ #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) #endif /* __KERNEL__ */ -- Tilman Schmidt E-Mail: [email protected] Bonn, Germany Diese Nachricht besteht zu 100% aus wiederverwerteten Bits. Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Attachment:
signature.asc
Description: OpenPGP digital signature
- Prev by Date: Re: [RFC][WIP] DIO simplification and AIO-DIO stability
- Next by Date: [JNI FCE-3210-C 32-bit PCI-to-Fibre Channel HBA]Driver for linux kernel 2.4 and/or 2.6?
- Previous by thread: Re: [PATCH] reduce syslog clutter
- Next by thread: 2.6.15 is having difficulty handling bad blocks
- Index(es):