Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic debug on by default?

127 views
Skip to first unread message

Sarah Sharp

unread,
Aug 14, 2013, 12:50:02 PM8/14/13
to
Hi Xenia,

I'm a bit confused. I thought that debugging messages would be turned
off by default for a module if CONFIG_DYNAMIC_DEBUG was turned on. When
I tested your patch to remove the CONFIG_USB_XHCI_HCD_DEBUGGING and just
use dev_dbg, the messages from the xHCI driver appeared in dmesg by
default.

That generates a lot of log spew. We can have distros add a boot
parameter option to turn off debug messages, but that boot parameter is
limited to 1023 characters. I'm concerned that if more drivers add
dynamic debugging, the distros will eventually run out of space in the
dynamic debugging boot parameter. I know Greg was ripping out debugging
config options in other USB drivers, so this is a bit concerning.

Jason, is there a way within the xHCI driver to say that dynamic
debugging should be off by default? I've looked through the
documentation, and I can't find anything like that documented.

I've attached my .config file, in case I have something misconfigured.

Sarah Sharp
.config

Joe Perches

unread,
Aug 14, 2013, 1:00:03 PM8/14/13
to
#undefine DEBUG

> I've attached my .config file, in case I have something misconfigured.

Because of:

drivers/usb/host/Makefile:ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG

you probably want to turn this off

CONFIG_USB_DEBUG=y

when dynamic_debug is on.

CONFIG_DYNAMIC_DEBUG=y

This will cause all pr_debug/dev_dbg statements to be
emitted without specific enabling via the dynamic_debug
control file.

(from include/linux/dynamic_debug.h)

#if defined DEBUG
#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT
#else
#define _DPRINTK_FLAGS_DEFAULT 0
#endif


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

Greg KH

unread,
Aug 14, 2013, 1:10:02 PM8/14/13
to
On Wed, Aug 14, 2013 at 09:51:54AM -0700, Joe Perches wrote:
> On Wed, 2013-08-14 at 09:40 -0700, Sarah Sharp wrote:
> > Hi Xenia,
> >
> > I'm a bit confused. I thought that debugging messages would be turned
> > off by default for a module if CONFIG_DYNAMIC_DEBUG was turned on. When
> > I tested your patch to remove the CONFIG_USB_XHCI_HCD_DEBUGGING and just
> > use dev_dbg, the messages from the xHCI driver appeared in dmesg by
> > default.
> >
> > That generates a lot of log spew. We can have distros add a boot
> > parameter option to turn off debug messages, but that boot parameter is
> > limited to 1023 characters. I'm concerned that if more drivers add
> > dynamic debugging, the distros will eventually run out of space in the
> > dynamic debugging boot parameter. I know Greg was ripping out debugging
> > config options in other USB drivers, so this is a bit concerning.
> >
> > Jason, is there a way within the xHCI driver to say that dynamic
> > debugging should be off by default? I've looked through the
> > documentation, and I can't find anything like that documented.
>
> #undefine DEBUG
>
> > I've attached my .config file, in case I have something misconfigured.
>
> Because of:
>
> drivers/usb/host/Makefile:ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG

Yes, that's the problem, I'm trying to get rid of the CONFIG_USB_DEBUG
flag, and I'm almost there. There are some host controllers that still
use it for some things that I have not cleaned up fully yet.

thanks,

greg k-h

Sarah Sharp

unread,
Aug 14, 2013, 1:30:01 PM8/14/13
to
Do you think those patches will land in 3.12? If not, I'll add an
#undefine DEBUG to xhci.h to avoid the log spew.

Sarah Sharp

Greg KH

unread,
Aug 14, 2013, 2:10:03 PM8/14/13
to
Don't undefine it, if a user sets CONFIG_USB_DEBUG they obviously want
to see that spew :)

As for when it can be removed, no, it's probably not going to make 3.12,
although a lot of the work is already done and in my usb-next tree.
There are still a number of places where this is still used in the host
controller drivers that I haven't cleaned up yet:

~/linux/work/usb/drivers/usb/host $ git grep -w "ifdef DEBUG" | wc -l
37

~/linux/work/usb/drivers/usb/host $ git grep -wl "ifdef DEBUG"
ehci-fsl.c
ehci-hcd.c
ehci-q.c
ehci.h
fotg210-hcd.c
fotg210.h
fusbh200-hcd.c
fusbh200.h
imx21-hcd.c
imx21-hcd.h
ohci-dbg.c
ohci-hcd.c
ohci-spear.c
ohci.h
oxu210hp-hcd.c
uhci-debug.c
uhci-hcd.c

The hardest ones will be ohci and ehci, as there are different code
paths for when debugging is enabled (the debug stats generation and
dumping).

I'm swamped with "real work" at the moment and will not get to these
anytime soon, but if someone else wants to pick up the work and run with
it, I would love to see it done.

thanks,

greg k-h

Jason Baron

unread,
Aug 14, 2013, 2:30:01 PM8/14/13
to
On 08/14/2013 12:51 PM, Joe Perches wrote:
> On Wed, 2013-08-14 at 09:40 -0700, Sarah Sharp wrote:
>> Hi Xenia,
>>
>> I'm a bit confused. I thought that debugging messages would be turned
>> off by default for a module if CONFIG_DYNAMIC_DEBUG was turned on. When
>> I tested your patch to remove the CONFIG_USB_XHCI_HCD_DEBUGGING and just
>> use dev_dbg, the messages from the xHCI driver appeared in dmesg by
>> default.
>>
>> That generates a lot of log spew. We can have distros add a boot
>> parameter option to turn off debug messages, but that boot parameter is
>> limited to 1023 characters. I'm concerned that if more drivers add
>> dynamic debugging, the distros will eventually run out of space in the
>> dynamic debugging boot parameter. I know Greg was ripping out debugging
>> config options in other USB drivers, so this is a bit concerning.
>>
>> Jason, is there a way within the xHCI driver to say that dynamic
>> debugging should be off by default? I've looked through the
>> documentation, and I can't find anything like that documented.
> #undefine DEBUG
>
>> I've attached my .config file, in case I have something misconfigured.
> Because of:
>
> drivers/usb/host/Makefile:ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
>
> you probably want to turn this off
>
> CONFIG_USB_DEBUG=y
>
> when dynamic_debug is on.

They should also be emitted in the case that dynamic_debug is off, but
we have set -DDEBUG, right? That was the whole point of enabling them
for dynamic debug too - to mirror the behavior of !CONFIG_DYNAMIC_DEBUG
case.

-Jason
0 new messages