ftrace: fix depends
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Linux Kernel Mailing List
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2db8054c1eaf99983d8deee347876b01c26c2cf Commit: c2db8054c1eaf99983d8deee347876b01c26c2cf Parent: bd95b88d9e51fcbf392a7e90338a8fcc3499cbd6 Author: Steven Rostedt <[email protected]> AuthorDate: Mon Oct 6 19:06:11 2008 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Mon Oct 20 18:27:02 2008 +0200ftrace: fix depends
Quoted 7 lines
A lot of tracers have
HAVE_FTRACEas a dependent config where it really should not. TheHAVE_FTRACEis a misnomer (soon to be fixed) and describes if the architecture has the function tracer (mcount) implemented. The ftrace infrastructure is implemented in all archs.Signed-off-by Steven Rostedt <[email protected]>Signed-off-by Ingo Molnar <[email protected]>
Hmm... this is not very true. I count three architectures which have this implemented plus arm with a 'depends on' plus sh with the broken HAVE_FTRACE instead of HAVE_FUNCTION_TRACER.
All other architectures will see something like this:
kernel/built-in.o: In function `tracer_alloc_buffers':
trace.c:(.init.text+0x42c2): undefined reference to nop_trace' trace.c:(.init.text+0x42ec): undefined reference to nop_trace'
make: *** [.tmp_vmlinux1] Error 1
Steven Rostedt
maintainerPATCH 1/1 ftrace: fix trace_nop config select
The trace_nop is the tracer that is defined when no tracer is set in the ftrace infrastructure.
The trace_nop was mistakenly selected by HAVE_FTRACE due to the confusion between ftrace infrastructure and the ftrace function tracer (which has been solved by renaming the function tracer).
This patch changes the select to the approriate TRACING.
This patch should fix compile errors on architectures that do not define the FUNCTION_TRACER.
--- kernel/trace/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/Kconfig +1 -1
@@ -8,7 +8,6 @@ config NOP_TRACER config HAVE_FUNCTION_TRACER bool - select NOP_TRACER config HAVE_DYNAMIC_FTRACE bool
@@ -28,6 +27,7 @@ config TRACING select RING_BUFFER select STACKTRACE select TRACEPOINTS + select NOP_TRACER menu "Tracers"
Ingo Molnar
AppliedRe: [PATCH] ftrace: fix trace_nop config select
Quoted 9 lines · Steven Rostedt
The
trace_nopis the tracer that is defined when no tracer is set in the ftrace infrastructure.The
trace_nopwas mistakenly selected byHAVE_FTRACEdue to the confusion between ftrace infrastructure and the ftrace function tracer (which has been solved by renaming the function tracer).This patch changes the select to the approriate TRACING.
Quoted 7 lines
This patch should fix compile errors on architectures that do not define the
FUNCTION_TRACER.Signed-off-by Steven Rostedt <[email protected]>--- kernel/trace/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
applied to tip/tracing/urgent, thanks Steve!
Ingo
Steven Rostedt
maintainerRFC PATCH 1/1 x86: add non x86 build configuration
In reply to Heiko CarstensA lot of developers develop on x86 architectures, and do things that sometimes breaks non x86 archs. This patch adds a debug option to turn off all the CONFIG_HAVE_ options that x86 sets. This allows developers to easily test their code to make sure that it compiles without a lot of the assumptions that x86 makes.
Note: Recently the ftrace code had an issue where a depend was set
by the wrong select, but that select was not set by all archs. This patch catches that issue when compiling on x86.
--- arch/x86/Kconfig | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
arch/x86/Kconfig +26 -1
@@ -18,11 +18,20 @@ config X86_64 ### Arch settings config X86 def_bool y + # configs needed by arch/x86 code + select HAVE_IOREMAP_PROT + +# make a choice to keep allyesconfig from choosing non x86 +choice + prompt "Configuration Model" + default NORMAL_X86_CONFIGURATION + +config NORMAL_X86_CONFIGURATION + prompt "Normal Configuration Model" select HAVE_AOUT if X86_32 select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_IDE select HAVE_OPROFILE - select HAVE_IOREMAP_PROT select HAVE_KPROBES select ARCH_WANT_OPTIONAL_GPIOLIB select HAVE_KRETPROBES
@@ -35,6 +44,22 @@ config X86 select HAVE_GENERIC_DMA_COHERENT if X86_32 select HAVE_EFFICIENT_UNALIGNED_ACCESS +config SIMULATE_NON_X86_CONFIGURATION + bool "Simulate non x86 configuration" + depends on DEBUG_KERNEL + help + Several developers just test on a x86 architecture, and sometimes + break non x86 architectures without realizing it. This config + option disables a lot of configurations that are set by + being x86. Any development should compile an allyesconfig + with this setting enabled. + + Note, the kernel should compile, there's no guarantee that it + will boot. + + If unsure, select "Normal Operation Model" +endchoice + config ARCH_DEFCONFIG string default "arch/x86/configs/i386_defconfig" if X86_32
Re: [PATCH][RFC] x86: add non x86 build configuration
Quoted 9 lines · Steven Rostedt
A lot of developers develop on x86 architectures, and do things that sometimes breaks non x86 archs. This patch adds a debug option to turn off all the
CONFIG_HAVE_options that x86 sets. This allows developers to easily test their code to make sure that it compiles without a lot of the assumptions that x86 makes.Note: Recently the ftrace code had an issue where a depend was set
by the wrong select, but that select was not set by all archs. This patch catches that issue when compiling on x86.
cool, very nice - thanks Steve!
testing this way scales _far_ better than maintaining a farm of cross-compilers.
One important detail: could you please flip around the modality of the option? Right now it's CONFIG_SIMULATE_NON_X86_CONFIGURATION, and that will be set by allyesconfig. But it has the exact opposite effect of an "all yes" config.
So please name it something like CONFIG_STANDARD_X86_FEATURES, and also make it depend on CONFIG_EMBEDDED (only allow it to be turned off when EMBEDDED is enabled).
ok?
Ingo
Steven Rostedt
maintainerRe: [PATCH][RFC] x86: add non x86 build configuration
Quoted 7 lines · Ingo Molnar
* Steven Rostedt <[email protected]> wrote:
One important detail: could you please flip around the modality of the option? Right now it's
CONFIG_SIMULATE_NON_X86_CONFIGURATION, and that will be set by allyesconfig. But it has the exact opposite effect of an "all yes" config.
Hmm, I made it a choice, with the "Normal Config" as default, so that allyesconfig will not set it. Does it get set for you when you do an allyesconfig? I had to do the following:
make allyesconfig
make menuconfig <change to NON x86>
to get this option on for testing.
Quoted 4 lines
So please name it something like
CONFIG_STANDARD_X86_FEATURES, and also make it depend onCONFIG_EMBEDDED(only allow it to be turned off when EMBEDDED is enabled).
I'll have to extend my Kbuild foo to learn to do these inverse selects.
-- Steve
Re: [PATCH][RFC] x86: add non x86 build configuration
Quoted 6 lines · Steven Rostedt
Quoted 3 lines · Ingo Molnar
* Steven Rostedt <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
One important detail: could you please flip around the modality of the option? Right now it's
CONFIG_SIMULATE_NON_X86_CONFIGURATION, and that will be set by allyesconfig. But it has the exact opposite effect of an "all yes" config.Hmm, I made it a choice, with the "Normal Config" as default, so that allyesconfig will not set it. Does it get set for you when you do an allyesconfig? I had to do the following:
hm, indeed.
Still ... the Kconfig glue looks a bit weird - it's almost never a good idea to put 'NOT' (or any other logic operator) into a config name. Why not make this CONFIG_STANDARD_X86_FEATURES and allow it to be disabled when CONFIG_EMBEDDED is enabled? This way it's not just a debug thing but also a kernel sizing feature.
Ingo
Steven Rostedt
maintainerRe: [PATCH][RFC] x86: add non x86 build configuration
Quoted 10 lines · Ingo Molnar
Quoted 4 lines
Hmm, I made it a choice, with the "Normal Config" as default, so that allyesconfig will not set it. Does it get set for you when you do an allyesconfig? I had to do the following:
hm, indeed.
Still ... the
Kconfigglue looks a bit weird - it's almost never a good idea to put 'NOT' (or any other logic operator) into a config name. Why not make thisCONFIG_STANDARD_X86_FEATURESand allow it to
OK
Quoted 2 lines
be disabled when
CONFIG_EMBEDDEDis enabled? This way it's not just a debug thing but also a kernel sizing feature.
But this affects other things than simply bloat features, like:
select HAVE_AOUT if X86_32
select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_IDE
select HAVE_GENERIC_DMA_COHERENT if X86_32 select HAVE_EFFICIENT_UNALIGNED_ACCESS
Having an option that lets EMBEDDED turn off some of the above might be confusing.
-- Steve
Re: [PATCH][RFC] x86: add non x86 build configuration
In reply to Ingo MolnarQuoted 4 lines
So please name it something like
CONFIG_STANDARD_X86_FEATURES, and also make it depend onCONFIG_EMBEDDED(only allow it to be turned off when EMBEDDED is enabled).
Any chance to introduce a CONFIG_EXPERT option?
CONFIG_EMBEDDED is supposed to be those features that may decrease performance or functionality but lower the footprint.
And not all the crap it covers today.
Sam
Re: [PATCH][RFC] x86: add non x86 build configuration
Quoted 9 lines · Sam Ravnborg
Quoted 3 lines
So please name it something like
CONFIG_STANDARD_X86_FEATURES, and also make it depend onCONFIG_EMBEDDED(only allow it to be turned off when EMBEDDED is enabled).Any chance to introduce a
CONFIG_EXPERToption?
CONFIG_EMBEDDEDis supposed to be those features that may decrease performance or functionality but lower the footprint. And not all the crap it covers today.
turning those features off will reduce the kernel's size as well - so i think it's appropriate in this specific case.
but i agree with your general point that CONFIG_EMBEDDED is abused in a few cases.
Ingo