mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Andrew V. Savochkin" <saw@saw.sw.com.sg>,
	cgl_discussion mailing list <cgl_discussion@osdl.org>,
	evlog mailing list <evlog-developers@lists.sourceforge.net>,
	"ipslinux (Keith Mitchell)" <ipslinux@us.ibm.com>,
	Linus Torvalds <torvalds@home.transmeta.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Hien Nguyen <hien@us.ibm.com>,
	James Keniston <kenistoj@us.ibm.com>,
	Mike Sullivan <sullivam@us.ibm.com>
Subject: Re: [PATCH-RFC} 3 of 4 - New problem logging macros, plus template generation
Date: Tue, 24 Sep 2002 15:47:15 +1000	[thread overview]
Message-ID: <20020924054804.334A52C0E9@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 23 Sep 2002 22:12:02 -0400." <3D8FC9F2.1020604@pobox.com>

In message <3D8FC9F2.1020604@pobox.com> you write:
> > +/*
> > + * introduce(), problem(), and detail() macros
> > + * Sample usage:
> > + *	problem(LOG_ALERT, "Disk on fire!",
> > + *		detail(disk, "%s", drive->name),
> > + *		detail(temperature, "%d", drive->degC),
> > + *		detail(action, "%s", "Put out fire; run fsck."));
> > + */
> 
> 
> action is policy, it does not belong in the kernel at all.

Yes, it's a bad example, but...

> Further, I not sure we need to add all this new infrastructure when
> we could obtain the same result via [off the top of my head] printk
> standards in key drivers.

They want to formalize it so you can template it.  Noone wants "ERR:
400001020567" on their console, so having a method of generating that
number from something which is readable in source (and by default
turns into a pretty printk) makes sense.

> Why don't you start out with a list of requirements that you want to see 
> from drivers?  Only then can we objectively evaluate our needs.
> 
> You are proposing a solution without really making it clear what 
> problems you are solving.

Driver error collection and reporting.  You want an automated
catalogue of all the error messages the kernel can produce.  You want
them to be consistent.  You want to be able to control the verbosity.
You want to be able to attach other mechanisms to collect them.  You
want to combine them with your userspace logging systems to give a
picture of machine state (think thousands of remotely administered
machines).

You *can* do this with printk, but only the most disciplined of
drivers do (eg. Becker net drivers are really good at putting "eth0:"
etc in messages, others are not so great).

For this to be useful, it has to be ubiquitous, and for that it has to
be *easier* than printk to use correctly (which is a hard challenge).

> If you actually want to standardize some diagnostic messages, it is a 
> huge mistake [as your scsi driver example shows] to continue to use 
> random text strings followed by a typed attribute list.  If you really 
> wanted to standardize logging, why continue to allow driver authors to 
> printk driver-specific text strings in lieu of a standard string that 
> applies to the same situation in N drivers.

I disagree.  In their non-printk backend, the strings are simply
hashed (with the driver name) into tokens: they're remarkably robust
against driver linenumber changes and minor code changes.

We don't have that much structure in the kernel: the helper macros the
minimal sufficient to ensure that the device is identified with every
problem.

There are nice things you can do with ratelimiting these messages
sanely as well, and translations.

I think the architecture is fairly sound, although the implementation
needs some tweaking.

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2002-09-24  5:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24  1:54 Larry Kessler
2002-09-24  2:12 ` Jeff Garzik
2002-09-24  5:47   ` Rusty Russell [this message]
2002-09-24  6:05     ` Jeff Garzik
2002-09-24  7:06       ` Rusty Russell
2002-09-24  7:23         ` Jeff Garzik
2002-09-24  7:30           ` Rusty Russell
2002-09-24 19:48             ` alternate event logging proposal Jeff Garzik
2002-09-24 19:57               ` Chris Friesen
2002-09-24 20:03                 ` Jeff Garzik
2002-09-24 20:54                   ` Tim Hockin
2002-09-24 22:32                     ` Brad Hards
2002-09-24 23:31                       ` Jeff Garzik
2002-09-24 23:37                         ` Brad Hards
2002-09-24 23:59                           ` Tim Hockin
2002-09-24 23:38                         ` Tim Hockin
2002-09-25  0:09                           ` Ben Greear
2002-09-25  0:47                             ` Tim Hockin
2002-09-25  1:14                               ` Brad Hards
2002-09-25  1:38                                 ` Tim Hockin
2002-09-24 20:09                 ` Jeff Garzik
2002-09-24 20:27                   ` [evlog-dev] " Larry Kessler
2002-09-24 20:35                     ` Jeff Garzik
2002-09-24 21:11                       ` Larry Kessler
2002-09-24 21:26                         ` Jeff Garzik
2002-09-25  0:15                           ` Larry Kessler
2002-09-24 21:27                         ` Horst von Brand
2002-09-24 21:50                           ` Larry Kessler
2002-09-25 14:44                 ` Lars Marowsky-Bree
2002-09-24 20:54               ` [evlog-dev] " Daniel E. F. Stekloff
2002-09-24 21:04                 ` Jeff Garzik
2002-09-30 22:43                 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020924054804.334A52C0E9@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cgl_discussion@osdl.org \
    --cc=evlog-developers@lists.sourceforge.net \
    --cc=hien@us.ibm.com \
    --cc=ipslinux@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=kenistoj@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saw@saw.sw.com.sg \
    --cc=sullivam@us.ibm.com \
    --cc=torvalds@home.transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®