* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 16:24 ` Linus Torvalds
@ 2008-01-15 16:32 ` Ingo Molnar
2008-01-15 17:02 ` Russell King
` (2 subsequent siblings)
3 siblings, 0 replies; 15+ messages in thread
From: Ingo Molnar @ 2008-01-15 16:32 UTC (permalink / raw)
To: Linus Torvalds
Cc: Russell King, Adrian Bunk, Andrew Morton, Mathieu Desnoyers,
Randy Dunlap, phil.el, oprofile-list, linux-kernel
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> But as mentioned, it's totally untested and I don't have (or really
> want to have) a cross-compiling environment. And I don't care *that*
> much. I just want something we can all live with.
>
> So does something like this work for people?
> arch/arm/Kconfig | 2 +-
> arch/arm/Kconfig.instrumentation | 52 ++++++++++++++++++++++++++++++++++++++
> 2 files changed, 53 insertions(+), 1 deletions(-)
i like this approach better, not the least because it affects only one
architecture so late in the .24-rc cycle. Instrumentation bugs tend to
be found with a few weeks/months of delays. (because historically
instrumentation has been typically used by folks who cannot change their
kernel easily to debug it, i.e. by extension they dont run bleeding edge
kernels either.)
Acked-by: Ingo Molnar <mingo@elte.hu>
Ingo
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 16:24 ` Linus Torvalds
2008-01-15 16:32 ` Ingo Molnar
@ 2008-01-15 17:02 ` Russell King
2008-01-15 17:37 ` Mathieu Desnoyers
2008-01-15 17:49 ` Russell King
3 siblings, 0 replies; 15+ messages in thread
From: Russell King @ 2008-01-15 17:02 UTC (permalink / raw)
To: Linus Torvalds
Cc: Adrian Bunk, Andrew Morton, Mathieu Desnoyers, Randy Dunlap,
phil.el, oprofile-list, linux-kernel
On Tue, Jan 15, 2008 at 08:24:34AM -0800, Linus Torvalds wrote:
> So does something like this work for people?
Just tested it and the right Kconfig symbols get set again - thanks.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 16:24 ` Linus Torvalds
2008-01-15 16:32 ` Ingo Molnar
2008-01-15 17:02 ` Russell King
@ 2008-01-15 17:37 ` Mathieu Desnoyers
2008-01-15 18:52 ` Linus Torvalds
2008-01-15 17:49 ` Russell King
3 siblings, 1 reply; 15+ messages in thread
From: Mathieu Desnoyers @ 2008-01-15 17:37 UTC (permalink / raw)
To: Linus Torvalds
Cc: Russell King, Adrian Bunk, Andrew Morton, Randy Dunlap, phil.el,
oprofile-list, linux-kernel
* Linus Torvalds (torvalds@linux-foundation.org) wrote:
>
>
> On Tue, 15 Jan 2008, Russell King wrote:
> >
> > I don't particularly like stuffing the options into some random place
> > in the architectures Kconfig file when they should stay along side the
> > instrumentation configuration entries.
>
> Well, I have to say that I don't particularly like obviously
> architecture-specific stuff in an obviously non-architecture file..
>
> I'd almost prefer to revert the thing that caused the problem, because
> with Adrian's patch, I think the end result may *work*, but it's uglier
> than what we started out with.
>
> However, I think the *cleanest* solution right now may be something like
> the appended. Totally untested, of course. It basically just copies the
> generic kernel/Kconfig.instrumentation file into the arm directory, makes
> arm use its own instead of the generic one, and removes the dependencies
> on ARM in there (including all of the KPROBES entry that apparently isn't
> an issue on ARM anyway). It then adds back the ARM-specific ones.
>
> This follows the sacred rules of good code:
>
> - generic code is either generic or not. If it's not generic, don't claim
> it is.
>
> - don't *force* people to use generic code if it doesn't suit them. Make
> it available for the cases it makes sense for, but don't shoe-horn it
> into cases where it doesn't work well.
>
> So it allows the sharing of the common case and *many* architectures end
> up using the generic Kconfig file, but hey, if it doesn't make sense for
> ARM, it doesn't make sense for ARM. It's that simple.
>
> But as mentioned, it's totally untested and I don't have (or really want
> to have) a cross-compiling environment. And I don't care *that* much. I
> just want something we can all live with.
>
> So does something like this work for people?
>
Hi,
Well, it goes along the lines of the patch I suggested as a reply to
Adrian, with these differences :
- I still source the kernel/Kconfig.instrumentation file.
- I put back the missing OPROFILE options directly in arch/arm/Kconfig
Then end result is the same as your patch, but without the code
duplication.
Here is the patch :
Fix ARMv6 oprofile support
This patch restores the ARMv6 OProfile support that was killed by
commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
It puts the config options in arch/arm/Kconfig.
Thanks to Adrian Bunk for finding this bug and providing an initial
patch.
Changelog :
Use def_bool.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Adrian Bunk <adrian.bunk@movial.fi>
CC: Randy Dunlap <randy.dunlap@oracle.com>
CC: rmk@arm.linux.org.uk
CC: phil.el@wanadoo.fr
CC: oprofile-list@lists.sourceforge.net
---
arch/arm/Kconfig | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: linux-2.6-lttng/arch/arm/Kconfig
===================================================================
--- linux-2.6-lttng.orig/arch/arm/Kconfig 2007-12-29 16:58:32.000000000 -0500
+++ linux-2.6-lttng/arch/arm/Kconfig 2007-12-29 16:59:25.000000000 -0500
@@ -130,6 +130,23 @@ config FIQ
config ARCH_MTD_XIP
bool
+if OPROFILE
+
+config OPROFILE_ARMV6
+ def_bool y
+ depends on CPU_V6 && !SMP
+ select OPROFILE_ARM11_CORE
+
+config OPROFILE_MPCORE
+ def_bool y
+ depends on CPU_V6 && SMP
+ select OPROFILE_ARM11_CORE
+
+config OPROFILE_ARM11_CORE
+ bool
+
+endif
+
config VECTORS_BASE
hex
default 0xffff0000 if MMU || CPU_HIGH_VECTOR
-
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 17:37 ` Mathieu Desnoyers
@ 2008-01-15 18:52 ` Linus Torvalds
2008-01-15 19:07 ` Mathieu Desnoyers
0 siblings, 1 reply; 15+ messages in thread
From: Linus Torvalds @ 2008-01-15 18:52 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Russell King, Adrian Bunk, Andrew Morton, Randy Dunlap, phil.el,
oprofile-list, linux-kernel
On Tue, 15 Jan 2008, Mathieu Desnoyers wrote:
>
> Well, it goes along the lines of the patch I suggested as a reply to
> Adrian, with these differences :
>
> - I still source the kernel/Kconfig.instrumentation file.
> - I put back the missing OPROFILE options directly in arch/arm/Kconfig
>
> Then end result is the same as your patch, but without the code
> duplication.
No it's not.
Now the config variables may all be there, but the UI for the *menu*
system is broken (ie all the ARM profiling config options are now outside
the profiling menu).
Is that menu really needed? I dunno. But since it exists, it should be
correct.
Linus
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 18:52 ` Linus Torvalds
@ 2008-01-15 19:07 ` Mathieu Desnoyers
2008-01-15 19:16 ` Sam Ravnborg
2008-01-15 20:10 ` Linus Torvalds
0 siblings, 2 replies; 15+ messages in thread
From: Mathieu Desnoyers @ 2008-01-15 19:07 UTC (permalink / raw)
To: Linus Torvalds, Sam Ravnborg
Cc: Russell King, Adrian Bunk, Andrew Morton, Randy Dunlap, phil.el,
oprofile-list, linux-kernel
* Linus Torvalds (torvalds@linux-foundation.org) wrote:
>
>
> On Tue, 15 Jan 2008, Mathieu Desnoyers wrote:
> >
> > Well, it goes along the lines of the patch I suggested as a reply to
> > Adrian, with these differences :
> >
> > - I still source the kernel/Kconfig.instrumentation file.
> > - I put back the missing OPROFILE options directly in arch/arm/Kconfig
> >
> > Then end result is the same as your patch, but without the code
> > duplication.
>
> No it's not.
>
> Now the config variables may all be there, but the UI for the *menu*
> system is broken (ie all the ARM profiling config options are now outside
> the profiling menu).
>
> Is that menu really needed? I dunno. But since it exists, it should be
> correct.
>
> Linus
There is an "instrumentation menu removal" patchset I've submitted to
Andrew for the next release cycle that moves the instrumentation menu
content into General setup (I did this following your advice).
Furthermore, on ARM, the OPROFILE_ARMV6, OPROFILE_MPCORE and
OPROFILE_ARM11_CORE are all "bool , default y" (equivalent to the
preferred def_bool y). Unless I am grossly mistaken, this is not
supposed to show up in the menus; it's just selected when the
dependencies are met.
Mathieu
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 19:07 ` Mathieu Desnoyers
@ 2008-01-15 19:16 ` Sam Ravnborg
2008-01-15 19:50 ` Mathieu Desnoyers
2008-01-15 20:10 ` Linus Torvalds
1 sibling, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2008-01-15 19:16 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Linus Torvalds, Russell King, Adrian Bunk, Andrew Morton,
Randy Dunlap, phil.el, oprofile-list, linux-kernel
On Tue, Jan 15, 2008 at 02:07:20PM -0500, Mathieu Desnoyers wrote:
> * Linus Torvalds (torvalds@linux-foundation.org) wrote:
> >
> >
> > On Tue, 15 Jan 2008, Mathieu Desnoyers wrote:
> > >
> > > Well, it goes along the lines of the patch I suggested as a reply to
> > > Adrian, with these differences :
> > >
> > > - I still source the kernel/Kconfig.instrumentation file.
> > > - I put back the missing OPROFILE options directly in arch/arm/Kconfig
> > >
> > > Then end result is the same as your patch, but without the code
> > > duplication.
> >
> > No it's not.
> >
> > Now the config variables may all be there, but the UI for the *menu*
> > system is broken (ie all the ARM profiling config options are now outside
> > the profiling menu).
> >
> > Is that menu really needed? I dunno. But since it exists, it should be
> > correct.
> >
> > Linus
>
> There is an "instrumentation menu removal" patchset I've submitted to
> Andrew for the next release cycle that moves the instrumentation menu
> content into General setup (I did this following your advice).
>
> Furthermore, on ARM, the OPROFILE_ARMV6, OPROFILE_MPCORE and
> OPROFILE_ARM11_CORE are all "bool , default y" (equivalent to the
> preferred def_bool y). Unless I am grossly mistaken, this is not
> supposed to show up in the menus; it's just selected when the
> dependencies are met.
This was the patch:
+if OPROFILE
+
+config OPROFILE_ARMV6
+ def_bool y
+ depends on CPU_V6 && !SMP
+ select OPROFILE_ARM11_CORE
+
+config OPROFILE_MPCORE
+ def_bool y
+ depends on CPU_V6 && SMP
+ select OPROFILE_ARM11_CORE
+
+config OPROFILE_ARM11_CORE
+ bool
+
+endif
And none of these has a prompt defined so they do not show up
as a menu.
It is very easy to test if you have the patch applied.
No cross toolchin is needed - just do:
make ARCH=arm menuconfig
Sam
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 19:16 ` Sam Ravnborg
@ 2008-01-15 19:50 ` Mathieu Desnoyers
0 siblings, 0 replies; 15+ messages in thread
From: Mathieu Desnoyers @ 2008-01-15 19:50 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Linus Torvalds, Russell King, Adrian Bunk, Andrew Morton,
Randy Dunlap, phil.el, oprofile-list, linux-kernel
* Sam Ravnborg (sam@ravnborg.org) wrote:
> On Tue, Jan 15, 2008 at 02:07:20PM -0500, Mathieu Desnoyers wrote:
> > * Linus Torvalds (torvalds@linux-foundation.org) wrote:
> > >
> > >
> > > On Tue, 15 Jan 2008, Mathieu Desnoyers wrote:
> > > >
> > > > Well, it goes along the lines of the patch I suggested as a reply to
> > > > Adrian, with these differences :
> > > >
> > > > - I still source the kernel/Kconfig.instrumentation file.
> > > > - I put back the missing OPROFILE options directly in arch/arm/Kconfig
> > > >
> > > > Then end result is the same as your patch, but without the code
> > > > duplication.
> > >
> > > No it's not.
> > >
> > > Now the config variables may all be there, but the UI for the *menu*
> > > system is broken (ie all the ARM profiling config options are now outside
> > > the profiling menu).
> > >
> > > Is that menu really needed? I dunno. But since it exists, it should be
> > > correct.
> > >
> > > Linus
> >
> > There is an "instrumentation menu removal" patchset I've submitted to
> > Andrew for the next release cycle that moves the instrumentation menu
> > content into General setup (I did this following your advice).
> >
> > Furthermore, on ARM, the OPROFILE_ARMV6, OPROFILE_MPCORE and
> > OPROFILE_ARM11_CORE are all "bool , default y" (equivalent to the
> > preferred def_bool y). Unless I am grossly mistaken, this is not
> > supposed to show up in the menus; it's just selected when the
> > dependencies are met.
>
> This was the patch:
> +if OPROFILE
> +
> +config OPROFILE_ARMV6
> + def_bool y
> + depends on CPU_V6 && !SMP
> + select OPROFILE_ARM11_CORE
> +
> +config OPROFILE_MPCORE
> + def_bool y
> + depends on CPU_V6 && SMP
> + select OPROFILE_ARM11_CORE
> +
> +config OPROFILE_ARM11_CORE
> + bool
> +
> +endif
>
> And none of these has a prompt defined so they do not show up
> as a menu.
> It is very easy to test if you have the patch applied.
> No cross toolchin is needed - just do:
> make ARCH=arm menuconfig
>
> Sam
Just tested with and without oprofile/MPCORE/CPU_V6 combinations and I
confirm that :
- no menu is showing up (as expected)
- the OPROFILE_* config options are selected (or not) as expected
Mathieu
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 19:07 ` Mathieu Desnoyers
2008-01-15 19:16 ` Sam Ravnborg
@ 2008-01-15 20:10 ` Linus Torvalds
1 sibling, 0 replies; 15+ messages in thread
From: Linus Torvalds @ 2008-01-15 20:10 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Sam Ravnborg, Russell King, Adrian Bunk, Andrew Morton,
Randy Dunlap, phil.el, oprofile-list, linux-kernel
On Tue, 15 Jan 2008, Mathieu Desnoyers wrote:
>
> Furthermore, on ARM, the OPROFILE_ARMV6, OPROFILE_MPCORE and
> OPROFILE_ARM11_CORE are all "bool , default y" (equivalent to the
> preferred def_bool y).
Ahh, I didn't notice that. If so, yes, it doesn't matter at all whether
it's inside the menu or not, of course.
Linus
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 16:24 ` Linus Torvalds
` (2 preceding siblings ...)
2008-01-15 17:37 ` Mathieu Desnoyers
@ 2008-01-15 17:49 ` Russell King
2008-01-15 18:06 ` Adrian Bunk
3 siblings, 1 reply; 15+ messages in thread
From: Russell King @ 2008-01-15 17:49 UTC (permalink / raw)
To: Linus Torvalds, Bryan Wu
Cc: Adrian Bunk, Andrew Morton, Mathieu Desnoyers, Randy Dunlap,
phil.el, oprofile-list, linux-kernel
On Tue, Jan 15, 2008 at 08:24:34AM -0800, Linus Torvalds wrote:
>
>
> On Tue, 15 Jan 2008, Russell King wrote:
> >
> > I don't particularly like stuffing the options into some random place
> > in the architectures Kconfig file when they should stay along side the
> > instrumentation configuration entries.
>
> Well, I have to say that I don't particularly like obviously
> architecture-specific stuff in an obviously non-architecture file..
>
> I'd almost prefer to revert the thing that caused the problem, because
> with Adrian's patch, I think the end result may *work*, but it's uglier
> than what we started out with.
>
> However, I think the *cleanest* solution right now may be something like
> the appended. Totally untested, of course. It basically just copies the
> generic kernel/Kconfig.instrumentation file into the arm directory, makes
> arm use its own instead of the generic one, and removes the dependencies
> on ARM in there (including all of the KPROBES entry that apparently isn't
> an issue on ARM anyway). It then adds back the ARM-specific ones.
>
> This follows the sacred rules of good code:
>
> - generic code is either generic or not. If it's not generic, don't claim
> it is.
>
> - don't *force* people to use generic code if it doesn't suit them. Make
> it available for the cases it makes sense for, but don't shoe-horn it
> into cases where it doesn't work well.
>
> So it allows the sharing of the common case and *many* architectures end
> up using the generic Kconfig file, but hey, if it doesn't make sense for
> ARM, it doesn't make sense for ARM. It's that simple.
>
> But as mentioned, it's totally untested and I don't have (or really want
> to have) a cross-compiling environment. And I don't care *that* much. I
> just want something we can all live with.
>
> So does something like this work for people?
BTW, your patch may fix ARM, but the original commit broke blackfin as
well - it removed the Kconfig entry for HARDWARE_PM, which is still used:
$ grep HARDWARE_PM arch/blackfin/ -r
arch/blackfin/mach-common/interrupt.S:#ifdef CONFIG_HARDWARE_PM
arch/blackfin/mach-common/interrupt.S:#ifdef CONFIG_HARDWARE_PM
arch/blackfin/mach-common/irqpanic.c:#ifdef CONFIG_HARDWARE_PM
arch/blackfin/oprofile/Makefile:oprofile-$(CONFIG_HARDWARE_PM) += op_model_bf533.o
arch/blackfin/oprofile/common.c:#ifdef CONFIG_HARDWARE_PM
So blackfin also needs fixing. I don't know if blackfin people are
aware of this.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: Fwd: Re: [2.6.24 patch] restore ARMv6 OProfile support
2008-01-15 17:49 ` Russell King
@ 2008-01-15 18:06 ` Adrian Bunk
0 siblings, 0 replies; 15+ messages in thread
From: Adrian Bunk @ 2008-01-15 18:06 UTC (permalink / raw)
To: Russell King
Cc: Linus Torvalds, Bryan Wu, Andrew Morton, Mathieu Desnoyers,
Randy Dunlap, phil.el, oprofile-list, linux-kernel
On Tue, Jan 15, 2008 at 05:49:48PM +0000, Russell King wrote:
>...
> So blackfin also needs fixing. I don't know if blackfin people are
> aware of this.
They are:
http://lkml.org/lkml/2007/12/28/100
> Russell King
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 15+ messages in thread