LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: ftrace: fix depends
       [not found] <200810281802.m9SI2fYX030138@hera.kernel.org>
@ 2008-10-29  9:18 ` Heiko Carstens
  2008-10-29 15:15   ` [PATCH] ftrace: fix trace_nop config select Steven Rostedt
  2008-10-30  1:43   ` [PATCH][RFC] x86: add non x86 build configuration Steven Rostedt
  0 siblings, 2 replies; 10+ messages in thread
From: Heiko Carstens @ 2008-10-29  9:18 UTC (permalink / raw)
  To: Ingo Molnar, Steven Rostedt; +Cc: linux-kernel, lethal

On Tue, Oct 28, 2008 at 06:02:41PM +0000, Linux Kernel Mailing List wrote:
> 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 <rostedt@goodmis.org>
> AuthorDate: Mon Oct 6 19:06:11 2008 -0400
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Mon Oct 20 18:27:02 2008 +0200
> 
>     ftrace: fix depends
>     
>     A lot of tracers have HAVE_FTRACE as a dependent config where it
>     really should not. The HAVE_FTRACE is 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 <srostedt@redhat.com>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>

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

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

* [PATCH] ftrace: fix trace_nop config select
  2008-10-29  9:18 ` ftrace: fix depends Heiko Carstens
@ 2008-10-29 15:15   ` Steven Rostedt
  2008-10-29 16:21     ` Ingo Molnar
  2008-10-30  1:43   ` [PATCH][RFC] x86: add non x86 build configuration Steven Rostedt
  1 sibling, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-10-29 15:15 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Andrew Morton, Linus Torvalds, Steven Noonan,
	Heiko Carstens


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.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-tip.git/kernel/trace/Kconfig
===================================================================
--- linux-tip.git.orig/kernel/trace/Kconfig	2008-10-29 10:37:49.000000000 -0400
+++ linux-tip.git/kernel/trace/Kconfig	2008-10-29 11:07:20.000000000 -0400
@@ -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"
 



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

* Re: [PATCH] ftrace: fix trace_nop config select
  2008-10-29 15:15   ` [PATCH] ftrace: fix trace_nop config select Steven Rostedt
@ 2008-10-29 16:21     ` Ingo Molnar
  0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2008-10-29 16:21 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Andrew Morton, Linus Torvalds, Steven Noonan, Heiko Carstens


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 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.
> 
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
>  kernel/trace/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied to tip/tracing/urgent, thanks Steve!

	Ingo

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

* [PATCH][RFC] x86: add non x86 build configuration
  2008-10-29  9:18 ` ftrace: fix depends Heiko Carstens
  2008-10-29 15:15   ` [PATCH] ftrace: fix trace_nop config select Steven Rostedt
@ 2008-10-30  1:43   ` Steven Rostedt
  2008-10-30 19:51     ` Ingo Molnar
  1 sibling, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-10-30  1:43 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Andrew Morton, Linus Torvalds, Heiko Carstens


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.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 arch/x86/Kconfig |   27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

Index: linux-tip.git/arch/x86/Kconfig
===================================================================
--- linux-tip.git.orig/arch/x86/Kconfig	2008-10-29 20:49:11.000000000 -0400
+++ linux-tip.git/arch/x86/Kconfig	2008-10-29 21:28:52.000000000 -0400
@@ -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



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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30  1:43   ` [PATCH][RFC] x86: add non x86 build configuration Steven Rostedt
@ 2008-10-30 19:51     ` Ingo Molnar
  2008-10-30 20:05       ` Steven Rostedt
  2008-10-30 20:20       ` Sam Ravnborg
  0 siblings, 2 replies; 10+ messages in thread
From: Ingo Molnar @ 2008-10-30 19:51 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Andrew Morton, Linus Torvalds, Heiko Carstens


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 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

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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30 19:51     ` Ingo Molnar
@ 2008-10-30 20:05       ` Steven Rostedt
  2008-10-30 20:57         ` Ingo Molnar
  2008-10-30 20:20       ` Sam Ravnborg
  1 sibling, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-10-30 20:05 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Andrew Morton, Linus Torvalds, Heiko Carstens


On Thu, 30 Oct 2008, Ingo Molnar wrote:

> 
> * Steven Rostedt <rostedt@goodmis.org> 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.

> 
> 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).

I'll have to extend my Kbuild foo to learn to do these inverse selects.

-- Steve


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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30 19:51     ` Ingo Molnar
  2008-10-30 20:05       ` Steven Rostedt
@ 2008-10-30 20:20       ` Sam Ravnborg
  2008-10-30 20:55         ` Ingo Molnar
  1 sibling, 1 reply; 10+ messages in thread
From: Sam Ravnborg @ 2008-10-30 20:20 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Steven Rostedt, LKML, Andrew Morton, Linus Torvalds, Heiko Carstens

> 
> 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).

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

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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30 20:20       ` Sam Ravnborg
@ 2008-10-30 20:55         ` Ingo Molnar
  0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2008-10-30 20:55 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Steven Rostedt, LKML, Andrew Morton, Linus Torvalds, Heiko Carstens


* Sam Ravnborg <sam@ravnborg.org> wrote:

> > 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).
> 
> 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.

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

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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30 20:05       ` Steven Rostedt
@ 2008-10-30 20:57         ` Ingo Molnar
  2008-10-30 21:09           ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2008-10-30 20:57 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Andrew Morton, Linus Torvalds, Heiko Carstens


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> On Thu, 30 Oct 2008, Ingo Molnar wrote:
> 
> > 
> > * Steven Rostedt <rostedt@goodmis.org> 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:

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

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

* Re: [PATCH][RFC] x86: add non x86 build configuration
  2008-10-30 20:57         ` Ingo Molnar
@ 2008-10-30 21:09           ` Steven Rostedt
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2008-10-30 21:09 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Andrew Morton, Linus Torvalds, Heiko Carstens


On Thu, 30 Oct 2008, Ingo Molnar wrote:
> > 
> > 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 

OK

> be disabled when CONFIG_EMBEDDED is 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


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

end of thread, other threads:[~2008-10-30 21:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200810281802.m9SI2fYX030138@hera.kernel.org>
2008-10-29  9:18 ` ftrace: fix depends Heiko Carstens
2008-10-29 15:15   ` [PATCH] ftrace: fix trace_nop config select Steven Rostedt
2008-10-29 16:21     ` Ingo Molnar
2008-10-30  1:43   ` [PATCH][RFC] x86: add non x86 build configuration Steven Rostedt
2008-10-30 19:51     ` Ingo Molnar
2008-10-30 20:05       ` Steven Rostedt
2008-10-30 20:57         ` Ingo Molnar
2008-10-30 21:09           ` Steven Rostedt
2008-10-30 20:20       ` Sam Ravnborg
2008-10-30 20:55         ` Ingo Molnar

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).