* dynamic-debug not built into scx200_acb, scx200_i2c
@ 2011-08-10 21:06 Jim Cromie
2011-08-10 23:50 ` Joe Perches
2011-08-10 23:52 ` Jason Baron
0 siblings, 2 replies; 15+ messages in thread
From: Jim Cromie @ 2011-08-10 21:06 UTC (permalink / raw)
To: LKML, linux-i2c
scx200_acb has several pr_debugs, but theyre not available via dynamic-debug
Ive been unable to figure out why.
Any ideas ?
jimc@chumly:~/projects/lx/linux-2.6$ grep debug drivers/i2c/busses/scx200_*
drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": ACBCTL2 readback failed\n");
drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": disabled, but
ACBCTL1=0x%02x\n",
drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": enabled, but NMINTE
won't be set, "
drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": NatSemi SCx200
ACCESS.bus Driver\n");
drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": NatSemi SCx200 I2C Driver\n");
drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": SCL=GPIO%02u,
SDA=GPIO%02u\n", scl, sda);
jimc@chumly:~/projects/lx/build-skc$ for k in `find drivers -name
\*.ko`; do echo $k; readelf -S $k |grep __verbose; done
drivers/i2c/busses/i2c-stub.ko
drivers/i2c/busses/i2c-gpio.ko
drivers/i2c/busses/scx200_i2c.ko
drivers/i2c/busses/scx200_acb.ko
drivers/i2c/muxes/gpio-i2cmux.ko
drivers/i2c/i2c-mux.ko
drivers/i2c/i2c-dev.ko
[15] __verbose PROGBITS 00000000 0018c8 0000c0 00 WA 0 0 8
[16] .rel__verbose REL 00000000 0024cc 000100 08 23 15 4
drivers/i2c/i2c-core.ko
[24] __verbose PROGBITS 00000000 003e58 000198 00 WA 0 0 8
[25] .rel__verbose REL 00000000 0058c8 000220 08 32 24 4
drivers/gpio/nsc_gpio.ko
[18] __verbose PROGBITS 00000000 000850 000090 00 WA 0 0 8
[19] .rel__verbose REL 00000000 0011bc 0000c0 08 26 18 4
drivers/gpio/pcf857x.ko
[14] __verbose PROGBITS 00000000 000e80 000048 00 WA 0 0 8
[15] .rel__verbose REL 00000000 001710 000060 08 22 14 4
drivers/gpio/pc8736x_gpio.ko
[17] __verbose PROGBITS 00000000 001140 0000a8 00 WA 0 0 8
[18] .rel__verbose REL 00000000 001da0 0000e0 08 25 17 4
drivers/gpio/scx200_gpio.ko
drivers/bluetooth/bfusb.ko
[14] __verbose PROGBITS 00000000 002160 000198 00 WA 0 0 8
[15] .rel__verbose REL 00000000 003108 000220 08 22 14 4
drivers/bluetooth/btusb.ko
[16] __verbose PROGBITS 00000000 002ca8 0001c8 00 WA 0 0 8
[17] .rel__verbose REL 00000000 003e44 000260 08 24 16 4
drivers/bluetooth/bcm203x.ko
[15] __verbose PROGBITS 00000000 000f78 000078 00 WA 0 0 8
[16] .rel__verbose REL 00000000 001a04 0000a0 08 23 15 4
drivers/bluetooth/hci_uart.ko
[17] __verbose PROGBITS 00000000 004068 000510 00 WA 0 0 8
[18] .rel__verbose REL 00000000 0060a4 0006c0 08 25 17 4
drivers/bluetooth/bpa10x.ko
[14] __verbose PROGBITS 00000000 0014f0 000120 00 WA 0 0 8
[15] .rel__verbose REL 00000000 002130 000180 08 22 14 4
drivers/connector/cn.ko
drivers/cpufreq/cpufreq_userspace.ko
[16] __verbose PROGBITS 00000000 0008b8 000078 00 WA 0 0 8
[17] .rel__verbose REL 00000000 001258 0000a0 08 24 16 4
drivers/cpufreq/gx-suspmod.ko
[16] __verbose PROGBITS 00000000 000f80 0000d8 00 WA 0 0 8
[17] .rel__verbose REL 00000000 001ae8 000120 08 25 16 4
drivers/cpufreq/cpufreq_ondemand.ko
drivers/cpufreq/cpufreq_performance.ko
[14] __verbose PROGBITS 00000000 000388 000018 00 WA 0 0 8
[15] .rel__verbose REL 00000000 000a30 000020 08 22 14 4
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: dynamic-debug not built into scx200_acb, scx200_i2c
@ 2011-08-10 23:50 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-10 23:50 UTC (permalink / raw)
To: Jim Cromie; +Cc: LKML, linux-i2c
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__)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: dynamic-debug not built into scx200_acb, scx200_i2c
@ 2011-08-10 23:50 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-10 23:50 UTC (permalink / raw)
To: Jim Cromie; +Cc: LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
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__)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: dynamic-debug not built into scx200_acb, scx200_i2c
@ 2011-08-10 23:52 ` Jason Baron
0 siblings, 0 replies; 15+ messages in thread
From: Jason Baron @ 2011-08-10 23:52 UTC (permalink / raw)
To: Jim Cromie; +Cc: LKML, linux-i2c
On Wed, Aug 10, 2011 at 03:06:49PM -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 ?
>
hmmm...I see drivers/i2c/busses/Makefile has:
ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
Any chance CONFIG_I2C_DEBUG_BUS is set?
Thanks,
-Jason
> jimc@chumly:~/projects/lx/linux-2.6$ grep debug drivers/i2c/busses/scx200_*
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": ACBCTL2 readback failed\n");
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": disabled, but
> ACBCTL1=0x%02x\n",
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": enabled, but NMINTE
> won't be set, "
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": NatSemi SCx200
> ACCESS.bus Driver\n");
> drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": NatSemi SCx200 I2C Driver\n");
> drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": SCL=GPIO%02u,
> SDA=GPIO%02u\n", scl, sda);
>
>
> jimc@chumly:~/projects/lx/build-skc$ for k in `find drivers -name
> \*.ko`; do echo $k; readelf -S $k |grep __verbose; done
> drivers/i2c/busses/i2c-stub.ko
> drivers/i2c/busses/i2c-gpio.ko
> drivers/i2c/busses/scx200_i2c.ko
> drivers/i2c/busses/scx200_acb.ko
> drivers/i2c/muxes/gpio-i2cmux.ko
> drivers/i2c/i2c-mux.ko
> drivers/i2c/i2c-dev.ko
> [15] __verbose PROGBITS 00000000 0018c8 0000c0 00 WA 0 0 8
> [16] .rel__verbose REL 00000000 0024cc 000100 08 23 15 4
> drivers/i2c/i2c-core.ko
> [24] __verbose PROGBITS 00000000 003e58 000198 00 WA 0 0 8
> [25] .rel__verbose REL 00000000 0058c8 000220 08 32 24 4
>
>
> drivers/gpio/nsc_gpio.ko
> [18] __verbose PROGBITS 00000000 000850 000090 00 WA 0 0 8
> [19] .rel__verbose REL 00000000 0011bc 0000c0 08 26 18 4
> drivers/gpio/pcf857x.ko
> [14] __verbose PROGBITS 00000000 000e80 000048 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 001710 000060 08 22 14 4
> drivers/gpio/pc8736x_gpio.ko
> [17] __verbose PROGBITS 00000000 001140 0000a8 00 WA 0 0 8
> [18] .rel__verbose REL 00000000 001da0 0000e0 08 25 17 4
> drivers/gpio/scx200_gpio.ko
> drivers/bluetooth/bfusb.ko
> [14] __verbose PROGBITS 00000000 002160 000198 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 003108 000220 08 22 14 4
> drivers/bluetooth/btusb.ko
> [16] __verbose PROGBITS 00000000 002ca8 0001c8 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 003e44 000260 08 24 16 4
> drivers/bluetooth/bcm203x.ko
> [15] __verbose PROGBITS 00000000 000f78 000078 00 WA 0 0 8
> [16] .rel__verbose REL 00000000 001a04 0000a0 08 23 15 4
> drivers/bluetooth/hci_uart.ko
> [17] __verbose PROGBITS 00000000 004068 000510 00 WA 0 0 8
> [18] .rel__verbose REL 00000000 0060a4 0006c0 08 25 17 4
> drivers/bluetooth/bpa10x.ko
> [14] __verbose PROGBITS 00000000 0014f0 000120 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 002130 000180 08 22 14 4
> drivers/connector/cn.ko
> drivers/cpufreq/cpufreq_userspace.ko
> [16] __verbose PROGBITS 00000000 0008b8 000078 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 001258 0000a0 08 24 16 4
> drivers/cpufreq/gx-suspmod.ko
> [16] __verbose PROGBITS 00000000 000f80 0000d8 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 001ae8 000120 08 25 16 4
> drivers/cpufreq/cpufreq_ondemand.ko
> drivers/cpufreq/cpufreq_performance.ko
> [14] __verbose PROGBITS 00000000 000388 000018 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 000a30 000020 08 22 14 4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: dynamic-debug not built into scx200_acb, scx200_i2c
@ 2011-08-10 23:52 ` Jason Baron
0 siblings, 0 replies; 15+ messages in thread
From: Jason Baron @ 2011-08-10 23:52 UTC (permalink / raw)
To: Jim Cromie; +Cc: LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, Aug 10, 2011 at 03:06:49PM -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 ?
>
hmmm...I see drivers/i2c/busses/Makefile has:
ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
Any chance CONFIG_I2C_DEBUG_BUS is set?
Thanks,
-Jason
> jimc@chumly:~/projects/lx/linux-2.6$ grep debug drivers/i2c/busses/scx200_*
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": ACBCTL2 readback failed\n");
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": disabled, but
> ACBCTL1=0x%02x\n",
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": enabled, but NMINTE
> won't be set, "
> drivers/i2c/busses/scx200_acb.c: pr_debug(NAME ": NatSemi SCx200
> ACCESS.bus Driver\n");
> drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": NatSemi SCx200 I2C Driver\n");
> drivers/i2c/busses/scx200_i2c.c: pr_debug(NAME ": SCL=GPIO%02u,
> SDA=GPIO%02u\n", scl, sda);
>
>
> jimc@chumly:~/projects/lx/build-skc$ for k in `find drivers -name
> \*.ko`; do echo $k; readelf -S $k |grep __verbose; done
> drivers/i2c/busses/i2c-stub.ko
> drivers/i2c/busses/i2c-gpio.ko
> drivers/i2c/busses/scx200_i2c.ko
> drivers/i2c/busses/scx200_acb.ko
> drivers/i2c/muxes/gpio-i2cmux.ko
> drivers/i2c/i2c-mux.ko
> drivers/i2c/i2c-dev.ko
> [15] __verbose PROGBITS 00000000 0018c8 0000c0 00 WA 0 0 8
> [16] .rel__verbose REL 00000000 0024cc 000100 08 23 15 4
> drivers/i2c/i2c-core.ko
> [24] __verbose PROGBITS 00000000 003e58 000198 00 WA 0 0 8
> [25] .rel__verbose REL 00000000 0058c8 000220 08 32 24 4
>
>
> drivers/gpio/nsc_gpio.ko
> [18] __verbose PROGBITS 00000000 000850 000090 00 WA 0 0 8
> [19] .rel__verbose REL 00000000 0011bc 0000c0 08 26 18 4
> drivers/gpio/pcf857x.ko
> [14] __verbose PROGBITS 00000000 000e80 000048 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 001710 000060 08 22 14 4
> drivers/gpio/pc8736x_gpio.ko
> [17] __verbose PROGBITS 00000000 001140 0000a8 00 WA 0 0 8
> [18] .rel__verbose REL 00000000 001da0 0000e0 08 25 17 4
> drivers/gpio/scx200_gpio.ko
> drivers/bluetooth/bfusb.ko
> [14] __verbose PROGBITS 00000000 002160 000198 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 003108 000220 08 22 14 4
> drivers/bluetooth/btusb.ko
> [16] __verbose PROGBITS 00000000 002ca8 0001c8 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 003e44 000260 08 24 16 4
> drivers/bluetooth/bcm203x.ko
> [15] __verbose PROGBITS 00000000 000f78 000078 00 WA 0 0 8
> [16] .rel__verbose REL 00000000 001a04 0000a0 08 23 15 4
> drivers/bluetooth/hci_uart.ko
> [17] __verbose PROGBITS 00000000 004068 000510 00 WA 0 0 8
> [18] .rel__verbose REL 00000000 0060a4 0006c0 08 25 17 4
> drivers/bluetooth/bpa10x.ko
> [14] __verbose PROGBITS 00000000 0014f0 000120 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 002130 000180 08 22 14 4
> drivers/connector/cn.ko
> drivers/cpufreq/cpufreq_userspace.ko
> [16] __verbose PROGBITS 00000000 0008b8 000078 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 001258 0000a0 08 24 16 4
> drivers/cpufreq/gx-suspmod.ko
> [16] __verbose PROGBITS 00000000 000f80 0000d8 00 WA 0 0 8
> [17] .rel__verbose REL 00000000 001ae8 000120 08 25 16 4
> drivers/cpufreq/cpufreq_ondemand.ko
> drivers/cpufreq/cpufreq_performance.ko
> [14] __verbose PROGBITS 00000000 000388 000018 00 WA 0 0 8
> [15] .rel__verbose REL 00000000 000a30 000020 08 22 14 4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 15+ messages in thread
* RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
2011-08-10 23:50 ` Joe Perches
@ 2011-08-11 0:01 ` Joe Perches
-1 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 0:01 UTC (permalink / raw)
To: Jim Cromie, Jason Baron; +Cc: LKML, linux-i2c
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?
^ permalink raw reply [flat|nested] 15+ messages in thread
* RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 0:01 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 0:01 UTC (permalink / raw)
To: Jim Cromie, Jason Baron; +Cc: LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
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?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
2011-08-11 0:01 ` Joe Perches
@ 2011-08-11 0:20 ` Jason Baron
-1 siblings, 0 replies; 15+ messages in thread
From: Jason Baron @ 2011-08-11 0:20 UTC (permalink / raw)
To: Joe Perches; +Cc: Jim Cromie, LKML, linux-i2c
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 0:20 ` Jason Baron
0 siblings, 0 replies; 15+ messages in thread
From: Jason Baron @ 2011-08-11 0:20 UTC (permalink / raw)
To: Joe Perches; +Cc: Jim Cromie, LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 1:03 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 1:03 UTC (permalink / raw)
To: Jason Baron; +Cc: Jim Cromie, LKML, linux-i2c
On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
> > 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.
You've got a bunch of patches ready to
be pulled/queued, so I think you should
do it.
cheers, Joe
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 1:03 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 1:03 UTC (permalink / raw)
To: Jason Baron; +Cc: Jim Cromie, LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
> > 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.
You've got a bunch of patches ready to
be pulled/queued, so I think you should
do it.
cheers, Joe
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
2011-08-11 1:03 ` Joe Perches
@ 2011-08-11 5:44 ` Jim Cromie
-1 siblings, 0 replies; 15+ messages in thread
From: Jim Cromie @ 2011-08-11 5:44 UTC (permalink / raw)
To: Joe Perches; +Cc: Jason Baron, LKML, linux-i2c
On Wed, Aug 10, 2011 at 7:03 PM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
>> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
>> > 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.
>
> You've got a bunch of patches ready to
> be pulled/queued, so I think you should
> do it.
>
> cheers, Joe
>
Thanks Joe,
Ive just added this. It works nicely, with one trivial change
to add MODNAME, imitating the common non-dynamic-debug usage:
#if defined DEBUG
#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT |
_DPRINTK_FLAGS_INCL_MODNAME
Ive tested the changes on scx200_acb, and changed
the printks therein to corresponding pr_<foo>
As I said, it works nicely.
Ive added these 2 patches to my series, which I'll be posting shortly.
In the meantime, its available at:
git://github.com/jimc/linux-2.6.git
in branch dyndbg-v4
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 5:44 ` Jim Cromie
0 siblings, 0 replies; 15+ messages in thread
From: Jim Cromie @ 2011-08-11 5:44 UTC (permalink / raw)
To: Joe Perches; +Cc: Jason Baron, LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, Aug 10, 2011 at 7:03 PM, Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> wrote:
> On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
>> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
>> > 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.
>
> You've got a bunch of patches ready to
> be pulled/queued, so I think you should
> do it.
>
> cheers, Joe
>
Thanks Joe,
Ive just added this. It works nicely, with one trivial change
to add MODNAME, imitating the common non-dynamic-debug usage:
#if defined DEBUG
#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT |
_DPRINTK_FLAGS_INCL_MODNAME
Ive tested the changes on scx200_acb, and changed
the printks therein to corresponding pr_<foo>
As I said, it works nicely.
Ive added these 2 patches to my series, which I'll be posting shortly.
In the meantime, its available at:
git://github.com/jimc/linux-2.6.git
in branch dyndbg-v4
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 6:06 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 6:06 UTC (permalink / raw)
To: Jim Cromie; +Cc: Jason Baron, LKML, linux-i2c
On Wed, 2011-08-10 at 23:44 -0600, Jim Cromie wrote:
> On Wed, Aug 10, 2011 at 7:03 PM, Joe Perches <joe@perches.com> wrote:
> > On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
> >> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
> >> > 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.
> > You've got a bunch of patches ready to
> > be pulled/queued, so I think you should
> > do it.
[]
> Ive just added this. It works nicely, with one trivial change
> to add MODNAME, imitating the common non-dynamic-debug usage:
> #if defined DEBUG
> #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT |
> _DPRINTK_FLAGS_INCL_MODNAME
Right now, I think you should _not_
add DPRINTK_FLAGS_INCL_MODNAME to the
DEBUG DPRINTK_FLAGS_DEFAULT nor should
INCL_MODNAME be added to any default output
style.
Look for things like:
pr_debug(PFX "foo...");
and
pr_debug("some_prefix: foo...");
For instance:
$ grep -rP --include=*.[ch] "pr_debug\s*\(\s*\"\w+:" *
There are just too many uses of pr_debug where
defaulting KBUILD_MODNAME on will just cause some
unnecessary duplication of output.
Maybe do this in a year or two when more of
the current printks are sifted.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: RFC: Use dynamic-debug with pr_debug when -DDEBUG is set
@ 2011-08-11 6:06 ` Joe Perches
0 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-08-11 6:06 UTC (permalink / raw)
To: Jim Cromie; +Cc: Jason Baron, LKML, linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, 2011-08-10 at 23:44 -0600, Jim Cromie wrote:
> On Wed, Aug 10, 2011 at 7:03 PM, Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> wrote:
> > On Wed, 2011-08-10 at 20:20 -0400, Jason Baron wrote:
> >> On Wed, Aug 10, 2011 at 05:01:37PM -0700, Joe Perches wrote:
> >> > 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.
> > You've got a bunch of patches ready to
> > be pulled/queued, so I think you should
> > do it.
[]
> Ive just added this. It works nicely, with one trivial change
> to add MODNAME, imitating the common non-dynamic-debug usage:
> #if defined DEBUG
> #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT |
> _DPRINTK_FLAGS_INCL_MODNAME
Right now, I think you should _not_
add DPRINTK_FLAGS_INCL_MODNAME to the
DEBUG DPRINTK_FLAGS_DEFAULT nor should
INCL_MODNAME be added to any default output
style.
Look for things like:
pr_debug(PFX "foo...");
and
pr_debug("some_prefix: foo...");
For instance:
$ grep -rP --include=*.[ch] "pr_debug\s*\(\s*\"\w+:" *
There are just too many uses of pr_debug where
defaulting KBUILD_MODNAME on will just cause some
unnecessary duplication of output.
Maybe do this in a year or two when more of
the current printks are sifted.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-08-11 6:06 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 21:06 dynamic-debug not built into scx200_acb, scx200_i2c Jim Cromie
2011-08-10 23:50 ` Joe Perches
2011-08-10 23:50 ` Joe Perches
2011-08-11 0:01 ` RFC: Use dynamic-debug with pr_debug when -DDEBUG is set Joe Perches
2011-08-11 0:01 ` Joe Perches
2011-08-11 0:20 ` Jason Baron
2011-08-11 0:20 ` Jason Baron
2011-08-11 1:03 ` Joe Perches
2011-08-11 1:03 ` Joe Perches
2011-08-11 5:44 ` Jim Cromie
2011-08-11 5:44 ` Jim Cromie
2011-08-11 6:06 ` Joe Perches
2011-08-11 6:06 ` Joe Perches
2011-08-10 23:52 ` dynamic-debug not built into scx200_acb, scx200_i2c Jason Baron
2011-08-10 23:52 ` Jason Baron
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.