Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Mahesh Bandewar <maheshb@google.com>
Cc: "David Miller" <davem@davemloft.net>,
	linux-netdev <netdev@vger.kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"Maciej Żenczykowski" <maze@google.com>,
	"Laurent Chavey" <chavey@google.com>,
	"Tim Hockin" <thockin@google.com>,
	brandon.philips@coreos.com, xemul@parallels.com
Subject: Re: [PATCH net-next v2] ipvlan: Initial check-in of the IPVLAN driver.
Date: Fri, 21 Nov 2014 01:20:36 +0000	[thread overview]
Message-ID: <1416532836.7215.13.camel@decadent.org.uk> (raw)
In-Reply-To: <CAF2d9jjrN4cDmtN_yKTe0BS+cAqE=hqgsT_6mOEBuMTTPOaPRg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

On Tue, 2014-11-18 at 21:27 -0800, Mahesh Bandewar wrote:
> On Tue, Nov 18, 2014 at 12:54 PM, David Miller <davem@davemloft.net> wrote:
> >
> > From: Mahesh Bandewar <maheshb@google.com>
> > Date: Sun, 16 Nov 2014 22:27:14 -0800
> >
> > > +/* Define IPVL_DEBUG and set the appropriate dbg_level for debugging. */
> > > +#ifdef       IPVL_DEBUG
> > > +/*
> > > + * 1 : non-datapath debugging
> > > + * 2 : Custom
> > > + * 3 : function enters and exists.
> > > + * 4 : printk in data path (be careful!)
> > > + */
> > > +#define IPVL_DBG_LEVEL 1
> > > +#define ipvlan_dbg(level, msg...)    do { \
> > > +                                             if (level <= IPVL_DBG_LEVEL) \
> > > +                                             printk(KERN_DEBUG msg); \
> > > +                                     } while (0)
> > > +#else
> > > +#define ipvlan_dbg(level, msg...) do { ; } while (0)
> > > +#endif
> >
> > The day of having code use custom local debug logging facilities is long
> > gone, please use a standard mechanism for this rather than home cooked
> > reimplementations.
> >
> Do you mean pr_err() / pr_warn() / pr_debug() etc.? or something else?
[...]

There are also netdev_err() etc. for logging with a net device as
context.

You can use the netif_err(), netif_dbg() etc. functions and implement
the ethtool {get,set}_msglevel operations to allow turning on and off
broad classes of log messages.

Finally, if CONFIG_DYNAMIC_DEBUG is enabled then debug logging messages
can be turned on and off at run-time (individually or by function, file
or module).

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  parent reply	other threads:[~2014-11-21  1:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  6:27 [PATCH net-next v2] ipvlan: Initial check-in of the IPVLAN driver Mahesh Bandewar
2014-11-18 20:54 ` David Miller
2014-11-19  5:27   ` Mahesh Bandewar
2014-11-19  5:48     ` David Miller
2014-11-21  1:20     ` Ben Hutchings [this message]
2014-11-21  6:38       ` Mahesh Bandewar

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=1416532836.7215.13.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=brandon.philips@coreos.com \
    --cc=chavey@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=maheshb@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=thockin@google.com \
    --cc=xemul@parallels.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