lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1416532836.7215.13.camel@decadent.org.uk>
Date:	Fri, 21 Nov 2014 01:20:36 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Mahesh Bandewar <maheshb@...gle.com>
Cc:	David Miller <davem@...emloft.net>,
	linux-netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Maciej Żenczykowski <maze@...gle.com>,
	Laurent Chavey <chavey@...gle.com>,
	Tim Hockin <thockin@...gle.com>, brandon.philips@...eos.com,
	xemul@...allels.com
Subject: Re: [PATCH net-next v2] ipvlan: Initial check-in of the IPVLAN
 driver.

On Tue, 2014-11-18 at 21:27 -0800, Mahesh Bandewar wrote:
> On Tue, Nov 18, 2014 at 12:54 PM, David Miller <davem@...emloft.net> wrote:
> >
> > From: Mahesh Bandewar <maheshb@...gle.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

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ