Re: [patch 1/3] kmsg: Kernel message catalog macros.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Martin Schwidefsky
Date: Saturday, August 16, 2008 - 11:06 am

On Fri, 2008-08-15 at 10:03 -0700, Tim Hockin wrote:

The invention of dev_printk was a good thing. It adds structure to the
messages if it is about a device. Before we had a simple printk that did
or did not include information about the device driver and the device
name. dev_printk makes sure that this information is always added.
BUT, what dev_printk does not do is to make sure that the message can be
uniquely identified so that the description of the message can be found
in the message catalog. Our approach is to combine the driver name and a
simple index into a message tag. The original dev_printk remains almost
unchanged. A typical hunk in the code looks like this:

@@ -24,8 +27,8 @@ static int zfcp_ccw_probe(struct ccw_dev

        down(&zfcp_data.config_sema);
        if (zfcp_adapter_enqueue(ccw_device)) {
-               dev_err(&ccw_device->dev,
-                       "Setup of data structures failed.\n");
+               kmsg_dev_err(73, &ccw_device->dev,
+                            "Setup of data structures failed.\n");
                retval = -EINVAL;
        }
        up(&zfcp_data.config_sema);

The kmsg_dev_printk still has almost the same structure, only the
message id is added. There is one real difference though:
the driver name is specified with KMSG_COMPONENT and not via
dev_driver_string(dev). We do that so that the kmsg-doc script can
actually find the driver name. The dev_driver_string(dev) is dynamic and
a static tool has a hard time to find the actual driver string.  

-- 
blue skies,
  Martin.

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


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Wed Jul 30, 9:56 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Kay Sievers, (Wed Jul 30, 3:02 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Jul 31, 1:35 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Jul 31, 1:36 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Jul 31, 2:10 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Wed Aug 6, 1:35 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Aug 7, 1:31 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Joe Perches, (Thu Aug 7, 8:59 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sat Aug 9, 5:03 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sat Aug 9, 5:08 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Tue Aug 12, 5:35 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Tue Aug 12, 9:33 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Wed Aug 13, 12:04 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Pavel Machek, (Wed Aug 13, 12:13 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Wed Aug 13, 7:50 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Wed Aug 13, 6:53 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Thu Aug 14, 8:40 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Aug 14, 10:04 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Aug 14, 10:07 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Thu Aug 14, 10:11 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Thu Aug 14, 11:50 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Thu Aug 14, 4:22 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Joe Perches, (Thu Aug 14, 8:08 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Thu Aug 14, 10:33 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Jan Blunck, (Fri Aug 15, 4:21 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Fri Aug 15, 8:39 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Fri Aug 15, 10:03 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rick Troth, (Fri Aug 15, 1:05 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sat Aug 16, 10:45 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sat Aug 16, 10:49 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sat Aug 16, 11:06 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Joe Perches, (Sat Aug 16, 12:36 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Sat Aug 16, 1:40 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rick Troth, (Sat Aug 16, 8:39 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Sat Aug 16, 10:11 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sun Aug 17, 10:27 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sun Aug 17, 10:28 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Sun Aug 17, 10:31 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Sun Aug 17, 10:33 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Pavel Machek, (Mon Aug 18, 2:23 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Tim Hockin, (Mon Aug 18, 10:51 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Mon Aug 25, 8:56 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Mon Aug 25, 6:38 pm)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Mon Sep 1, 5:28 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Rusty Russell, (Tue Sep 2, 6:34 am)
Re: [patch 1/3] kmsg: Kernel message catalog macros., Martin Schwidefsky, (Tue Sep 2, 7:16 am)