public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jason Baron <jbaron@redhat.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: ehci dynamic debug problem
Date: Fri, 13 Apr 2012 19:41:07 +0200	[thread overview]
Message-ID: <20120413174107.GA6021@sig21.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1204131110250.1163-100000@iolanthe.rowland.org>

On Fri, Apr 13, 2012 at 11:19:37AM -0400, Alan Stern wrote:
> On Fri, 13 Apr 2012, Johannes Stezenbach wrote:
> 
> > On Fri, Apr 13, 2012 at 10:35:59AM -0400, Alan Stern wrote:
> > > On Fri, 13 Apr 2012, Johannes Stezenbach wrote:
> > > > 
> > > > Does dynamic debug offer an "is the message two lines below enabled" test?
> > > > Simply changing the "#ifdef DEBUG" for dbg_port_buf()
> > > > to "#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)"
> > > > is probably not acceptable due to the overhead of dbg_port_buf()?
> > > 
> > > I don't understand your question.  Doesn't dbg_port_buf need to be 
> > > defined whenever dynamic debugging is enabled?
> > > 
> > > Alternatively, the definition of dbg_port_buf (and related routines) in 
> > > the !defined(DEBUG) case could be changed; you could add
> > > 
> > > 	buf[0] = 0;
> > > 
> > > That way you wouldn't get garbage out, although you wouldn't get 
> > > anything useful either.
> > 
> > The ideal solution I'm looking for gives useful output
> > when dynamic debugging is enabled for ehci, but does no
> > useless string formatting when CONFIG_DYNAMIC_DEBUG is y
> > but the dynamic debug for ehci is disabled.
> 
> But there is no such thing as dynamic debug for ehci, is there?  
> There's a separate dynamic debug setting for each dev_dbg statement.
> So your ideal solution makes no sense.

When CONFIG_DYNAMIC_DEBUG=y but ehci debug is disabled
in /sys/kernel/debug/dynamic_debug/control, then
dbg_port() calls dbg_port_buf() which would
format the string, then calls ehci_dbg() which
calls dev_dbg() which discards it.

Does it make sense now?


Thanks,
Johannes

  reply	other threads:[~2012-04-13 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  8:56 ehci dynamic debug problem Johannes Stezenbach
2012-04-13 14:35 ` Alan Stern
2012-04-13 14:57   ` Johannes Stezenbach
2012-04-13 15:19     ` Alan Stern
2012-04-13 17:41       ` Johannes Stezenbach [this message]
2012-04-13 18:13         ` Alan Stern
2012-04-13 19:03           ` Johannes Stezenbach
2012-04-13 19:40             ` Alan Stern
2012-04-16 15:11             ` Alan Stern
2012-04-16 15:54             ` Jason Baron
2012-04-16 16:41               ` Johannes Stezenbach
2012-04-16 17:15                 ` Jason Baron
2012-04-16 19:07                   ` Johannes Stezenbach

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=20120413174107.GA6021@sig21.net \
    --to=js@sig21.net \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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