Re: [patch 2/6] kmsg: tagged device messages.

Previous thread: [patch 1/6] kmsg: tagged kernel messages. by Martin Schwidefsky on Thursday, September 25, 2008 - 9:28 am. (7 messages)

Next thread: [patch 4/6] kmsg: convert xpram messages to kmsg api. by Martin Schwidefsky on Thursday, September 25, 2008 - 9:28 am. (1 message)
From: Martin Schwidefsky
Date: Thursday, September 25, 2008 - 9:28 am

From: Martin Schwidefsky <schwidefsky@de.ibm.com>
From: Michael Holzheu <holzheu@de.ibm.com>

Add CONFIG_MSG_IDS support to the dev_xxx printk family. The message
tag for a device printk consists of the driver name and the 24 bit
hash over the message text. The hash is included in the printed line
if the KMSG_COMPONENT macro is defined and CONFIG_MSG_IDS=y. For
source files that do not define KMSG_COMPONENT or CONFIG_MSG_IDS=n
the dev_xxx printks use the old-style format. 

To make it possible for a script to extract the correct message tag
for the dev_xxx printks the KMSG_COMPONENT and the driver name need to
be identical for all dev_xxx printks in a source file. If a source file
is supposed to be converted to use message tags and there are dev_xxx
printks with driver names different to KMSG_COMPONENT these dev_xxx
printks need to be replaced with kmsg_xxx printks. In praxis this
should not be a problem since there are very few dev_xxx printks outside
of driver code.

In addition to the KMSG_COMPONENT changes in include/linux/device.h the
dev_xxx macros with variable arguments are converted from the gcc specific
'## arg' to the C99 variant '##__VA_ARGS__'.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 include/linux/device.h |   57 ++++++++++++++++++++++++++++++-------------------
 kernel/printk.c        |   22 ++++++++++++++++++
 2 files changed, 57 insertions(+), 22 deletions(-)

Index: kmsg-2.6/include/linux/device.h
===================================================================
--- kmsg-2.6.orig/include/linux/device.h
+++ kmsg-2.6/include/linux/device.h
@@ -520,39 +520,52 @@ extern void sysdev_shutdown(void);
 
 /* debugging and troubleshooting/diagnostic helpers. */
 extern const char *dev_driver_string(const struct device *dev);
-#define dev_printk(level, dev, format, arg...)	\
+#define dev_printk(level, dev, format, ...)	\
 	printk(level "%s %s: " format , dev_driver_string(dev) , \
-	 ...
From: Greg KH
Date: Friday, September 26, 2008 - 10:57 am

Nice, thanks for reworking this.  Feel free to add:
	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
here.

Note that you will get some merge errors with -next in device.h due to
the dynamic debug printk work that is in my tree and in -next as well.
But it should be simple to resolve.

thanks,

greg k-h
--

From: Martin Schwidefsky
Date: Saturday, September 27, 2008 - 4:11 pm

Is the dynamic debug printk work going upstream with the next merge
window? If yes then I'll wait until it hit Linus tree and update my
patch.

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.


--

From: Greg KH
Date: Saturday, September 27, 2008 - 7:04 pm

Yes, it is slated for 2.6.28 inclusion and is in the -next and -mm
releases.

thanks,

greg k-h
--

Previous thread: [patch 1/6] kmsg: tagged kernel messages. by Martin Schwidefsky on Thursday, September 25, 2008 - 9:28 am. (7 messages)

Next thread: [patch 4/6] kmsg: convert xpram messages to kmsg api. by Martin Schwidefsky on Thursday, September 25, 2008 - 9:28 am. (1 message)