linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
@ 2011-06-05  8:21 Josh Triplett
  2011-06-06 10:56 ` Peter Oberparleiter
  2011-06-06 15:52 ` Américo Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Josh Triplett @ 2011-06-05  8:21 UTC (permalink / raw)
  To: Peter Oberparleiter, Rusty Russell, WANG Cong, Sam Ravnborg,
	Jeff Dike, Andi Kleen, Huang Ying, Li Wei, Michael Ellerman,
	Ingo Molnar, Heiko Carstens, Martin Schwidefsky, Al Viro,
	Andrew Morton, Linus Torvalds, linux-kernel

CONFIG_CONSTRUCTORS controls support for running constructor functions
at kernel init time.  According to commit
b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL)
needs this.  However, CONFIG_CONSTRUCTORS currently defaults to y, with
no option to disable it, and CONFIG_GCOV_KERNEL depends on it.  Instead,
default it to n and have CONFIG_GCOV_KERNEL select it, so that the
normal case of CONFIG_GCOV_KERNEL=n will result in
CONFIG_CONSTRUCTORS=n.

Observed in the short list of =y values in a minimal kernel
configuration.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
CCing people copied on the original commit
b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7.

 init/Kconfig        |    1 -
 kernel/gcov/Kconfig |    3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index ebafac4..e9bf65f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -19,7 +19,6 @@ config DEFCONFIG_LIST
 config CONSTRUCTORS
 	bool
 	depends on !UML
-	default y
 
 config HAVE_IRQ_WORK
 	bool
diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
index b8cadf7..5bf924d 100644
--- a/kernel/gcov/Kconfig
+++ b/kernel/gcov/Kconfig
@@ -2,7 +2,8 @@ menu "GCOV-based kernel profiling"
 
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
-	depends on DEBUG_FS && CONSTRUCTORS
+	depends on DEBUG_FS
+	select CONSTRUCTORS
 	default n
 	---help---
 	This option enables gcov-based code profiling (e.g. for code coverage
-- 
1.7.5.3


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

* Re: [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
  2011-06-05  8:21 [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL Josh Triplett
@ 2011-06-06 10:56 ` Peter Oberparleiter
  2011-06-06 22:11   ` Josh Triplett
  2011-06-06 15:52 ` Américo Wang
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Oberparleiter @ 2011-06-06 10:56 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Rusty Russell, WANG Cong, Sam Ravnborg, Jeff Dike, Andi Kleen,
	Huang Ying, Li Wei, Michael Ellerman, Ingo Molnar,
	Heiko Carstens, Martin Schwidefsky, Al Viro, Andrew Morton,
	Linus Torvalds, linux-kernel

On 05.06.2011 10:21, Josh Triplett wrote:
> CONFIG_CONSTRUCTORS controls support for running constructor functions
> at kernel init time.  According to commit
> b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL)
> needs this.  However, CONFIG_CONSTRUCTORS currently defaults to y, with
> no option to disable it, and CONFIG_GCOV_KERNEL depends on it.  Instead,
> default it to n and have CONFIG_GCOV_KERNEL select it, so that the
> normal case of CONFIG_GCOV_KERNEL=n will result in
> CONFIG_CONSTRUCTORS=n.
>
> Observed in the short list of =y values in a minimal kernel
> configuration.
>
> Signed-off-by: Josh Triplett<josh@joshtriplett.org>
> ---

I tested this patch and GCOV profiling still works with it applied. To 
my knowledge, GCOV profiling is the only kernel mechanism using GCC's 
constructors and this may save some bytes.

Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>


Regards,
   Peter


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

* Re: [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
  2011-06-05  8:21 [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL Josh Triplett
  2011-06-06 10:56 ` Peter Oberparleiter
@ 2011-06-06 15:52 ` Américo Wang
  1 sibling, 0 replies; 5+ messages in thread
From: Américo Wang @ 2011-06-06 15:52 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Peter Oberparleiter, Rusty Russell, Sam Ravnborg, Jeff Dike,
	Andi Kleen, Huang Ying, Li Wei, Michael Ellerman, Ingo Molnar,
	Heiko Carstens, Martin Schwidefsky, Al Viro, Andrew Morton,
	Linus Torvalds, linux-kernel

On Sun, Jun 5, 2011 at 4:21 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> CONFIG_CONSTRUCTORS controls support for running constructor functions
> at kernel init time.  According to commit
> b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL)
> needs this.  However, CONFIG_CONSTRUCTORS currently defaults to y, with
> no option to disable it, and CONFIG_GCOV_KERNEL depends on it.  Instead,
> default it to n and have CONFIG_GCOV_KERNEL select it, so that the
> normal case of CONFIG_GCOV_KERNEL=n will result in
> CONFIG_CONSTRUCTORS=n.
>
> Observed in the short list of =y values in a minimal kernel
> configuration.
>
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>

Yeah, this is reasonable, so,

Acked-by: WANG Cong <xiyou.wangcong@gmail.com>

Thanks!

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

* Re: [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
  2011-06-06 10:56 ` Peter Oberparleiter
@ 2011-06-06 22:11   ` Josh Triplett
  2011-06-07  2:39     ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2011-06-06 22:11 UTC (permalink / raw)
  To: Peter Oberparleiter
  Cc: Rusty Russell, WANG Cong, Sam Ravnborg, Jeff Dike, Andi Kleen,
	Huang Ying, Li Wei, Michael Ellerman, Ingo Molnar,
	Heiko Carstens, Martin Schwidefsky, Al Viro, Andrew Morton,
	Linus Torvalds, linux-kernel

On Mon, Jun 06, 2011 at 12:56:33PM +0200, Peter Oberparleiter wrote:
> On 05.06.2011 10:21, Josh Triplett wrote:
> >CONFIG_CONSTRUCTORS controls support for running constructor functions
> >at kernel init time.  According to commit
> >b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL)
> >needs this.  However, CONFIG_CONSTRUCTORS currently defaults to y, with
> >no option to disable it, and CONFIG_GCOV_KERNEL depends on it.  Instead,
> >default it to n and have CONFIG_GCOV_KERNEL select it, so that the
> >normal case of CONFIG_GCOV_KERNEL=n will result in
> >CONFIG_CONSTRUCTORS=n.
> >
> >Observed in the short list of =y values in a minimal kernel
> >configuration.
> >
> >Signed-off-by: Josh Triplett<josh@joshtriplett.org>
> >---
> 
> I tested this patch and GCOV profiling still works with it applied.
> To my knowledge, GCOV profiling is the only kernel mechanism using
> GCC's constructors and this may save some bytes.
> 
> Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>

Excellent, thanks for testing and acking.

What tree should this patch go through?

- Josh Triplett

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

* Re: [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
  2011-06-06 22:11   ` Josh Triplett
@ 2011-06-07  2:39     ` Américo Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Américo Wang @ 2011-06-07  2:39 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Peter Oberparleiter, Rusty Russell, Sam Ravnborg, Jeff Dike,
	Andi Kleen, Huang Ying, Li Wei, Michael Ellerman, Ingo Molnar,
	Heiko Carstens, Martin Schwidefsky, Al Viro, Andrew Morton,
	Linus Torvalds, linux-kernel

On Tue, Jun 7, 2011 at 6:11 AM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Mon, Jun 06, 2011 at 12:56:33PM +0200, Peter Oberparleiter wrote:
>> On 05.06.2011 10:21, Josh Triplett wrote:
>> >CONFIG_CONSTRUCTORS controls support for running constructor functions
>> >at kernel init time.  According to commit
>> >b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL)
>> >needs this.  However, CONFIG_CONSTRUCTORS currently defaults to y, with
>> >no option to disable it, and CONFIG_GCOV_KERNEL depends on it.  Instead,
>> >default it to n and have CONFIG_GCOV_KERNEL select it, so that the
>> >normal case of CONFIG_GCOV_KERNEL=n will result in
>> >CONFIG_CONSTRUCTORS=n.
>> >
>> >Observed in the short list of =y values in a minimal kernel
>> >configuration.
>> >
>> >Signed-off-by: Josh Triplett<josh@joshtriplett.org>
>> >---
>>
>> I tested this patch and GCOV profiling still works with it applied.
>> To my knowledge, GCOV profiling is the only kernel mechanism using
>> GCC's constructors and this may save some bytes.
>>
>> Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
>
> Excellent, thanks for testing and acking.
>
> What tree should this patch go through?
>

Andrew is supposed to take this. :)

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

end of thread, other threads:[~2011-06-07  2:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-05  8:21 [PATCH] Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL Josh Triplett
2011-06-06 10:56 ` Peter Oberparleiter
2011-06-06 22:11   ` Josh Triplett
2011-06-07  2:39     ` Américo Wang
2011-06-06 15:52 ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).