Re: Proposal: Alan Cox dev_printk() with advanced logging support

From: Greg KH (
Date: Fri Dec 13 2002 - 00:47:23 EST

On Thu, Dec 12, 2002 at 05:40:01PM -0800, Larry Kessler wrote:
> The version of dev_printk() being proposed here is essentially a
> generalized version of these macros, with a small change to Alan's
> version so that driver name and bus_id are prepended to the
> message...
> #define dev_printk(sev, dev, format, arg...) \
> printk(sev "%s %s: " format, (dev).driver->name, (dev).bus_id, ##arg)
> Then the logging macros in device.h can be re-written like this...
> #define dev_err(dev, format, arg...) \
> dev_printk(KERN_ERR, (dev), format, ## arg)
> ..and so on.

I'd gladly accept a patch to add dev_printk() like this right now, if
you want. But make sure you get the proper spacing to work properly on
older versions of gcc. Your above macros are incorrect with regards to
that :)

> What is _not_ addressed by this proposal are a number of other issues raised
> in the past, that still need addressing. For example...
> 1) (from Jeff Garzik) There's little or no stanardization of messages across
> different (but similar) devices.
> 2) (from Jeff Garzik and Greg KH) There's little or no guidance about what device
> specific details are most useful for Problem Determination, Sys Administration,
> etc.
> However, consistently identifying which device, plus state info from the device
> struct, plus other info. like source file, function name, and line number,
> provided with event logging, should certainly be useful in some cases.
> As the device struct continues to evolve, it will become more clear which
> device attributes are appropriate to log.

I really feel strongly that these questions need to be answered properly
before we start adding the larger event logging stuff to the main kernel

Oh yeah, patches to actually _use_ these dev_*() functions would also be
appreciated. It looks like only one very tiny driver subsystem has
started to use them. Patches from your group to change this would be


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:28 EST