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: <20110811002039.GA3552@redhat.com>
Date:	Wed, 10 Aug 2011 20:20:40 -0400
From:	Jason Baron <jbaron@...hat.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Jim Cromie <jim.cromie@...il.com>,
	LKML <linux-kernel@...r.kernel.org>, linux-i2c@...r.kernel.org
Subject: Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set

On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
> On Wed, 2011-08-10 at 16:50 -0700, Joe Perches wrote:
> > On Wed, 2011-08-10 at 15:06 -0600, Jim Cromie wrote:
> > > scx200_acb has several pr_debugs, but theyre not available via dynamic-debug
> > > Ive been unable to figure out why.
> > > Any ideas ?
> > -DDEBUG forces pr_debug to be output and doesn't
> > allow dynamic_debug for those outputs.
> > from drivers/i2c/busses/Makefile:
> > ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
> > from printk.h:
> > /* If you are writing a driver, please use dev_dbg instead */
> > #if defined(DEBUG)
> > #define pr_debug(fmt, ...) \
> > 	printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> > #elif defined(CONFIG_DYNAMIC_DEBUG)
> > /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
> > #define pr_debug(fmt, ...) \
> > 	dynamic_pr_debug(fmt, ##__VA_ARGS__)
> 
> Perhaps another way to enable pr_debug use
> is to reverse the order of dynamic_pr_debug
> defines.
> 
> ie:  change printk.h:
> 
> #if defined(CONFIG_DYNAMIC_DEBUG)
> /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
> #define pr_debug(fmt, ...) \
> 	dynamic_pr_debug(fmt, ##__VA_ARGS__)
> #elif defined(DEBUG)
> #define pr_debug(fmt, ...) \
> 	printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> 
> and change dynamic_debug.h:
> 
> #define DPRINTK_FLAGS_DEFAULT 0
> 
> to:
> 
> #if defined DEBUG
> #define DPRINTK_FLAGS_DEFAULT DPRINTK_FLAGS_PRINT
> #else
> #define DPRINT_FLAGS_DEFAULT 0
> #endif
> 
> That seems pretty sensible to me.  Jason?
> 

cool idea. I like it.

-Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ