All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Keniston <jkenisto@us.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Greg KH <greg@kroah.com>, LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@oss.sgi.com>,
	"Feldman, Scott" <scott.feldman@intel.com>,
	Larry Kessler <kessler@us.ibm.com>,
	Randy Dunlap <rddunlap@osdl.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 1/4] Net device error logging, revised
Date: Tue, 26 Aug 2003 18:07:57 -0700	[thread overview]
Message-ID: <3F4C046D.77CF7E03@us.ibm.com> (raw)
In-Reply-To: 3F4BF265.5050101@pobox.com

Jeff Garzik wrote:
> 
> Jim Keniston wrote:
> > #define netdev_printk(sevlevel, netdev, msglevel, format, arg...)     \
> > do {                                                                  \
> > if (NETIF_MSG_##msglevel == NETIF_MSG_ALL || ((netdev)->msg_enable & NETIF_MSG_##msglevel)) { \
> >       char pfx[40];                                                   \
> >       printk(sevlevel "%s: " format , make_netdev_msg_prefix(pfx, netdev) , ## arg);  \
> > }} while (0)
> >
> > This would make your code bigger, but not that much bigger for the common case where
> > the msglevel is omitted (and the 'if(...)' is optimized out).
> 
> "NETIF_MSG_" is silly and should be eliminated.

>From this, I infer that you think that the option to "omit" the msglevel arg --
e.g.,
	netdev_err(dev,, "NIC is fried!\n");	/* always logged */
-- is silly.  No big deal.  Its sole purpose is to help keep netdev_* calls terse.

> A separate "NETIF_MSG_ALL" test is not needed, because msg_enable is a
> bitmask.  A msg_enable of 0xffffffff will naturally create a NETIF_MSG_ALL.

But how do you code a netdev_* call where you ALWAYS want the message (including
netdev_printk-style prefix) logged, regardless of the value of msg_enable?  That's
what NETIF_MSG_ALL is for (and why it might be better called NETIF_MSG_ALWAYS)...
	netdev_err(dev, ALL, "NIC is fried!\n");	/* always logged */
or
	netdev_err(dev, ALWAYS, "NIC is fried!\n");	/* always logged */

> 
> Also, whatever mechanism is created, it needs to preserve the feature of
> the existing system:
> 
>         if (a quick bitmask test)
>                 do something
> 
> And preferably "do something" is not inlined, because printk'ing --
> although it may appear in a fast path during debugging -- cannot be
> considered a fast path itself.
> 
>         Jeff

Sorry, I'm not sure what you're getting at here.  netdev_* doesn't prevent
people from using the existing netif_msg_* macros; it just provides shorthand
for the (usual) case where "do something" is "printk".

Jim

  reply	other threads:[~2003-08-27  1:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-25 21:31 [PATCH 1/4] Net device error logging, revised Jim Keniston
2003-08-25 21:39 ` Subject: [PATCH 2/4] Net device error logging, revised (e100) Jim Keniston
2003-08-25 21:41 ` Subject: [PATCH 3/4] Net device error logging, revised (e1000) Jim Keniston
2003-08-25 21:43 ` [PATCH 4/4] Net device error logging, revised (tg3) Jim Keniston
2003-08-26 18:32 ` [PATCH 1/4] Net device error logging, revised Greg KH
2003-08-26 23:34   ` Jim Keniston
2003-08-26 23:51     ` Jeff Garzik
2003-08-27  1:07       ` Jim Keniston [this message]
2003-09-03 17:32         ` Jeff Garzik
2003-09-03 20:56           ` Jim Keniston
2003-08-27  1:06     ` Stephen Hemminger
2003-08-29 21:22       ` Jim Keniston
2003-09-15 23:08 ` [PATCH] " Jim Keniston

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=3F4C046D.77CF7E03@us.ibm.com \
    --to=jkenisto@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=jgarzik@pobox.com \
    --cc=kessler@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=rddunlap@osdl.org \
    --cc=scott.feldman@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.