public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dynamic_debug: Remove unnecessary __used
@ 2012-10-18 19:07 Joe Perches
  2012-10-18 19:20 ` Jason Baron
  2012-10-18 19:40 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Perches @ 2012-10-18 19:07 UTC (permalink / raw)
  To: Jason Baron; +Cc: Greg KH, linux-kernel

The __used attribute prevents gcc from eliminating
unnecessary, otherwise optimized away, metadata for
debugging logging messages.

Remove the __used attribute.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/linux/dynamic_debug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index c18257b..6dd4787 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
 			 const char *fmt, ...);
 
 #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)		\
-	static struct _ddebug __used __aligned(8)		\
+	static struct _ddebug  __aligned(8)			\
 	__attribute__((section("__verbose"))) name = {		\
 		.modname = KBUILD_MODNAME,			\
 		.function = __func__,				\



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] dynamic_debug: Remove unnecessary __used
  2012-10-18 19:07 [PATCH] dynamic_debug: Remove unnecessary __used Joe Perches
@ 2012-10-18 19:20 ` Jason Baron
  2012-10-18 21:02   ` Greg KH
  2012-10-18 19:40 ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Baron @ 2012-10-18 19:20 UTC (permalink / raw)
  To: Joe Perches; +Cc: Greg KH, linux-kernel

On Thu, Oct 18, 2012 at 12:07:03PM -0700, Joe Perches wrote:
> The __used attribute prevents gcc from eliminating
> unnecessary, otherwise optimized away, metadata for
> debugging logging messages.
> 
> Remove the __used attribute.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  include/linux/dynamic_debug.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index c18257b..6dd4787 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
>  			 const char *fmt, ...);
>  
>  #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)		\
> -	static struct _ddebug __used __aligned(8)		\
> +	static struct _ddebug  __aligned(8)			\
>  	__attribute__((section("__verbose"))) name = {		\
>  		.modname = KBUILD_MODNAME,			\
>  		.function = __func__,				\
> 
> 

Greg, Pls pull this.

Acked-by: Jason Baron <jbaron@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dynamic_debug: Remove unnecessary __used
  2012-10-18 19:07 [PATCH] dynamic_debug: Remove unnecessary __used Joe Perches
  2012-10-18 19:20 ` Jason Baron
@ 2012-10-18 19:40 ` Greg KH
  2012-10-18 19:59   ` Joe Perches
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2012-10-18 19:40 UTC (permalink / raw)
  To: Joe Perches; +Cc: Jason Baron, linux-kernel

On Thu, Oct 18, 2012 at 12:07:03PM -0700, Joe Perches wrote:
> The __used attribute prevents gcc from eliminating
> unnecessary, otherwise optimized away, metadata for
> debugging logging messages.
> 
> Remove the __used attribute.

Very cool.  Any idea how much space this saves?

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dynamic_debug: Remove unnecessary __used
  2012-10-18 19:40 ` Greg KH
@ 2012-10-18 19:59   ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2012-10-18 19:59 UTC (permalink / raw)
  To: Greg KH; +Cc: Jason Baron, linux-kernel

On Thu, 2012-10-18 at 12:40 -0700, Greg KH wrote:
> On Thu, Oct 18, 2012 at 12:07:03PM -0700, Joe Perches wrote:
> > The __used attribute prevents gcc from eliminating
> > unnecessary, otherwise optimized away, metadata for
> > debugging logging messages.
> > 
> > Remove the __used attribute.
> 
> Very cool.  Any idea how much space this saves?

Dunno, it's been a while since I did an allyesconfig on my
netbook, my recollection is that was a few hundred kb.

https://lkml.org/lkml/2012/5/17/340



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dynamic_debug: Remove unnecessary __used
  2012-10-18 19:20 ` Jason Baron
@ 2012-10-18 21:02   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2012-10-18 21:02 UTC (permalink / raw)
  To: Jason Baron; +Cc: Joe Perches, linux-kernel

On Thu, Oct 18, 2012 at 03:20:08PM -0400, Jason Baron wrote:
> On Thu, Oct 18, 2012 at 12:07:03PM -0700, Joe Perches wrote:
> > The __used attribute prevents gcc from eliminating
> > unnecessary, otherwise optimized away, metadata for
> > debugging logging messages.
> > 
> > Remove the __used attribute.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  include/linux/dynamic_debug.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> > index c18257b..6dd4787 100644
> > --- a/include/linux/dynamic_debug.h
> > +++ b/include/linux/dynamic_debug.h
> > @@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
> >  			 const char *fmt, ...);
> >  
> >  #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)		\
> > -	static struct _ddebug __used __aligned(8)		\
> > +	static struct _ddebug  __aligned(8)			\
> >  	__attribute__((section("__verbose"))) name = {		\
> >  		.modname = KBUILD_MODNAME,			\
> >  		.function = __func__,				\
> > 
> > 
> 
> Greg, Pls pull this.

I will, thanks.

greg "here, have a vowel or three" k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-18 21:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18 19:07 [PATCH] dynamic_debug: Remove unnecessary __used Joe Perches
2012-10-18 19:20 ` Jason Baron
2012-10-18 21:02   ` Greg KH
2012-10-18 19:40 ` Greg KH
2012-10-18 19:59   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox