Re: [RFC/PATCH] Documentation of kernel messages
From: holzheu
Date: Wed Jun 13 2007 - 14:21:46 EST
Hi Greg,
> Ick, why are you ignoring what we have already with dev_printk() and
> friends? We are just finally getting developers to use that, I think it
> will be almost impossible to get people to change to something else,
> especially one that isn't even as "correct" as what dev_printk() offers
> you today, will be quite hard.
>
> So, why not use what we already have and work off of it?
dev_printk() and friends are great, since they already define something
like KMSG_COMPONENT: The driver name.
But they unfortunately do not solve our problem. We need an identifier
for a documented message in order to find the right description for a
message.
We could add new dev_printk macros for KMSG printks:
#define dev_printk_kmsg(kmsg, dev, format, arg...) \
printk(kmsg "%s: " format , (dev)->bus_id , ## arg)
#define dev_err_kmsg(dev, nr, format, arg...) \
dev_printk_kmsg(KMSG_ERR(nr) , dev , format , ## arg)
E.g. hub.c:
===========
#define KMSG_COMPONENT "hub"
dev_err_kmsg(&udev->dev, 1,
"can't read configurations, error %d\n", err);
Which would result in:
hub.1 5-0:1.0: can't read configuration error 4711
Michael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/