From: Jason Baron <jbaron@redhat.com>
To: Jim Cromie <jim.cromie@gmail.com>
Cc: Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [RFC PATCH] dynamic_debug: Remove __used attribute from metadata
Date: Wed, 23 May 2012 15:06:03 -0400 [thread overview]
Message-ID: <20120523190602.GD23940@redhat.com> (raw)
In-Reply-To: <CAJfuBxw4F-nsEwn6Nh2swo+j4xJprTb_e5o4tOjuJSqqEeCUhA@mail.gmail.com>
On Wed, May 23, 2012 at 12:00:29PM -0600, Jim Cromie wrote:
> On Thu, May 17, 2012 at 2:02 PM, Joe Perches <joe@perches.com> wrote:
> > The __used attribute in the declaration of the
> > dynamic_debug metadata stops the compiler from
> > optimizing and eliminating constant tests and
> > the metadata declaration used in things like:
> >
> > #define DEBUG_LEVEL 0
> > if (DEBUG_LEVEL > 1)
> > pr_debug("foo...");
> >
> > This is a common construct for debugging macros
> > with a constant "level" test.
> >
> > When dynamic_debug is not configured, this is
> > pr_debug and format string is eliminated unless
> > DEBUG_LEVEL is greater than 1.
> >
> > Remove the unnecessary __used attribute so the
> > even the dynamic_debug use of pr_debug can be
> > appropriately optimized away completely.
> >
>
>
> Im a bit puzzled - the __used attr is in the
> #if defined(CONFIG_DYNAMIC_DEBUG) branch.
>
> If its not config'd, the METADATA is not compiled,
> and this should have no effect.
> Did you mean enabled instead of configured ?
>
> FWIW, removing __used causes no harm here,
> ie it doesnt break dynamic-debug facility.
>
> Still, Id like to hear from Jason, he wrote it.
Yeah, can't recall atm why its there. I agree that since the call sites
reference the '_ddebug' structure it should be unecessary. So feel free
to add:
Acked-by: Jason Baron <jbaron@redhat.com>
Thanks,
-Jason
prev parent reply other threads:[~2012-05-23 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-17 20:02 [RFC PATCH] dynamic_debug: Remove __used attribute from metadata Joe Perches
2012-05-23 18:00 ` Jim Cromie
2012-05-23 18:10 ` Joe Perches
2012-05-23 19:06 ` Jason Baron [this message]
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=20120523190602.GD23940@redhat.com \
--to=jbaron@redhat.com \
--cc=gregkh@suse.de \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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