Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_KERNEL
PATCH 1/1 Disable CONFIG_CONSTRUCTORS when not needed by CONFIG_GCOV_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.
---
CCing people copied on the original commitb99b87f70c7785ab1e253c6220f4b0b57ce3a7f7.
init/Kconfig | 1 - kernel/gcov/Kconfig | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-)
init/Kconfig +0 -1
@@ -19,7 +19,6 @@ config DEFCONFIG_LIST config CONSTRUCTORS bool depends on !UML - default y config HAVE_IRQ_WORK bool
kernel/gcov/Kconfig +2 -1
@@ -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
Signature · 1 line
1.7.5.3
Quoted 9 lines · Josh Triplett
CONFIG_CONSTRUCTORScontrols support for running constructor functions at kernel init time. According to commitb99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL) needs this. However,CONFIG_CONSTRUCTORScurrently defaults to y, with no option to disable it, andCONFIG_GCOV_KERNELdepends on it. Instead, default it to n and haveCONFIG_GCOV_KERNELselect it, so that the normal case ofCONFIG_GCOV_KERNEL=nwill result inCONFIG_CONSTRUCTORS=n.
Quoted 5 lines
Observed in the short list of =y values in a minimal kernel configuration.
Signed-off-by Josh Triplett<[email protected]>---
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.
Regards,
Peter
Quoted 13 lines · Peter Oberparleiter
Quoted 12 lines · Josh Triplett
CONFIG_CONSTRUCTORScontrols support for running constructor functions at kernel init time. According to commitb99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL) needs this. However,CONFIG_CONSTRUCTORScurrently defaults to y, with no option to disable it, andCONFIG_GCOV_KERNELdepends on it. Instead, default it to n and haveCONFIG_GCOV_KERNELselect it, so that the normal case ofCONFIG_GCOV_KERNEL=nwill result inCONFIG_CONSTRUCTORS=n.Observed in the short list of =y values in a minimal kernel configuration.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Josh Triplett<[email protected]>---
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.
Excellent, thanks for testing and acking.
What tree should this patch go through?
- Josh Triplett
Quoted 21 lines · Josh Triplett
Quoted 20 lines · Peter Oberparleiter
Quoted 9 lines · Josh Triplett
CONFIG_CONSTRUCTORScontrols support for running constructor functions at kernel init time. According to commitb99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL) needs this. However,CONFIG_CONSTRUCTORScurrently defaults to y, with no option to disable it, andCONFIG_GCOV_KERNELdepends on it. Instead, default it to n and haveCONFIG_GCOV_KERNELselect it, so that the normal case ofCONFIG_GCOV_KERNEL=nwill result inCONFIG_CONSTRUCTORS=n.Quoted 5 lines
Observed in the short list of =y values in a minimal kernel configuration.
Signed-off-by Josh Triplett<[email protected]>---
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.
Quoted 6 lines
Quoted 1 line
Excellent, thanks for testing and acking.
What tree should this patch go through?
Andrew is supposed to take this. :)
Quoted 9 lines · Josh Triplett
CONFIG_CONSTRUCTORScontrols support for running constructor functions at kernel init time. According to commitb99b87f70c7785ab1e253c6220f4b0b57ce3a7f7, gcov (CONFIG_GCOV_KERNEL) needs this. However,CONFIG_CONSTRUCTORScurrently defaults to y, with no option to disable it, andCONFIG_GCOV_KERNELdepends on it. Instead, default it to n and haveCONFIG_GCOV_KERNELselect it, so that the normal case ofCONFIG_GCOV_KERNEL=nwill result inCONFIG_CONSTRUCTORS=n.
Quoted 4 lines
Observed in the short list of =y values in a minimal kernel configuration.
Signed-off-by Josh Triplett <[email protected]>
Yeah, this is reasonable, so,
Thanks!