Messages in this thread |  | | Date | Mon, 18 Mar 2002 13:48:12 -0800 | From | Larry Kessler <> | Subject | Re: [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y |
| |
Tony.P.Lee@nokia.com wrote: > How about this? > > int printk_improve(const char* filename, int line_no, > const char* function_name, int module_buf_idx, ...); > > #define printk(PRINTF_ARGS...) \ > printk_improve(__FILE__, __LINE__, __FUNCTION__, \ > CUR_MODULE_BUF_IDX, ##PRINTF_ARGS);
When printk is defined as a macro... "directives may not be used inside a macro argument" ...is the error caused by this style of coding:
printk("generic options" #ifdef AUTOPROBE_IRQ "AUTOPROBE_IRQ" #else "AUTOSENSE" #endif );
In the 2.5.6 kernel, the complete list of source files with directives inside the printk arg list: drivers/net/tulip/de4x5.c drivers/net/de620.c drivers/net/de600.c drivers/net/slip.c drivers/scsi/oktagon_esp.c drivers/scsi/sun3_NCR5380.c drivers/scsi/sym53c8xx.c drivers/scsi/NCR5380.c drivers/scsi/mac_NCR5380.c drivers/scsi/ncr53c8xx.c drivers/scsi/seagate.c drivers/scsi/atari_scsi.c drivers/scsi/atari_NCR5380.c drivers/s390/s390io.c arch/ppc/8xx_io/fec.c arch/alpha/kernel/setup.c arch/s390x/kernel/setup.c arch/s390/kernel/setup.c sound/oss/msnd_pinnacle.c fs/ntfs/fs.c
It is possible to submit patches to all of the maintainers explaining that we wish to collect a standard set of info with each call to printk, so please accept this patch, but is it reasonable to prohibit this coding style ?
On a related note, there are 554 #defines in the kernel that contain "printk" in the first line, so there is some customization going on already. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |