2007-12-28 19:18:25

by Adrian Bunk

[permalink] [raw]
Subject: [2.6.24 patch] restore blackfin HARDWARE_PM support

This patch restores the blackfin Hardware Performance Monitor Profiling
support that was killed by
commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.

Signed-off-by: Adrian Bunk <[email protected]>

---

kernel/Kconfig.instrumentation | 9 +++++++++
1 file changed, 9 insertions(+)

942996f33f81726c5edb012d61ecdad70c55884d
diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
index 97c76ca..e023671 100644
--- a/kernel/Kconfig.instrumentation
+++ b/kernel/Kconfig.instrumentation
@@ -44,2 +44,11 @@ config OPROFILE_MPCORE

+config HARDWARE_PM
+ tristate "Hardware Performance Monitor Profiling"
+ depends on BLACKFIN && PROFILING
+ help
+ take use of hardware performance monitor to profiling the kernel
+ and application.
+
+ If unsure, say N.
+
config KPROBES


2007-12-28 19:19:19

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

* Adrian Bunk ([email protected]) wrote:
> This patch restores the blackfin Hardware Performance Monitor Profiling
> support that was killed by
> commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
>
> Signed-off-by: Adrian Bunk <[email protected]>
>

Yep, this one too must be put back, but kernel/Kconfig.instrumentation
seems like the wrong spot for a blackfin-specific config option (and
this will break the instrumentation menu removal patches in -mm).

Can we put this in arch/blackfin/Kconfig instead ?

> ---
>
> kernel/Kconfig.instrumentation | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> 942996f33f81726c5edb012d61ecdad70c55884d
> diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
> index 97c76ca..e023671 100644
> --- a/kernel/Kconfig.instrumentation
> +++ b/kernel/Kconfig.instrumentation
> @@ -44,2 +44,11 @@ config OPROFILE_MPCORE
>
> +config HARDWARE_PM
> + tristate "Hardware Performance Monitor Profiling"
> + depends on BLACKFIN && PROFILING
> + help
> + take use of hardware performance monitor to profiling the kernel
> + and application.
> +
> + If unsure, say N.
> +
> config KPROBES
>

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

2007-12-28 19:23:40

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

On Fri, Dec 28, 2007 at 02:14:04PM -0500, Mathieu Desnoyers wrote:
> * Adrian Bunk ([email protected]) wrote:
> > This patch restores the blackfin Hardware Performance Monitor Profiling
> > support that was killed by
> > commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
> >
> > Signed-off-by: Adrian Bunk <[email protected]>
> >
>
> Yep, this one too must be put back, but kernel/Kconfig.instrumentation
> seems like the wrong spot for a blackfin-specific config option (and
> this will break the instrumentation menu removal patches in -mm).
>
> Can we put this in arch/blackfin/Kconfig instead ?

No, this is a user visible option that belongs into the same menu as
"Profling support".

> > ---
> >
> > kernel/Kconfig.instrumentation | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > 942996f33f81726c5edb012d61ecdad70c55884d
> > diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
> > index 97c76ca..e023671 100644
> > --- a/kernel/Kconfig.instrumentation
> > +++ b/kernel/Kconfig.instrumentation
> > @@ -44,2 +44,11 @@ config OPROFILE_MPCORE
> >
> > +config HARDWARE_PM
> > + tristate "Hardware Performance Monitor Profiling"
> > + depends on BLACKFIN && PROFILING
> > + help
> > + take use of hardware performance monitor to profiling the kernel
> > + and application.
> > +
> > + If unsure, say N.
> > +
> > config KPROBES
> >
>
> Mathieu Desnoyers

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

2007-12-28 19:34:14

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

* Adrian Bunk ([email protected]) wrote:
> On Fri, Dec 28, 2007 at 02:14:04PM -0500, Mathieu Desnoyers wrote:
> > * Adrian Bunk ([email protected]) wrote:
> > > This patch restores the blackfin Hardware Performance Monitor Profiling
> > > support that was killed by
> > > commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
> > >
> > > Signed-off-by: Adrian Bunk <[email protected]>
> > >
> >
> > Yep, this one too must be put back, but kernel/Kconfig.instrumentation
> > seems like the wrong spot for a blackfin-specific config option (and
> > this will break the instrumentation menu removal patches in -mm).
> >
> > Can we put this in arch/blackfin/Kconfig instead ?
>
> No, this is a user visible option that belongs into the same menu as
> "Profling support".
>

Actually, I wonder why these options exist at all rather than being on
by default when profiling is enabled. There is no such thing as
"activating the performance monitor profiling" on other architectures.
What is so special about blackfin that makes it need it ?

> > > ---
> > >
> > > kernel/Kconfig.instrumentation | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > 942996f33f81726c5edb012d61ecdad70c55884d
> > > diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
> > > index 97c76ca..e023671 100644
> > > --- a/kernel/Kconfig.instrumentation
> > > +++ b/kernel/Kconfig.instrumentation
> > > @@ -44,2 +44,11 @@ config OPROFILE_MPCORE
> > >
> > > +config HARDWARE_PM
> > > + tristate "Hardware Performance Monitor Profiling"
> > > + depends on BLACKFIN && PROFILING
> > > + help
> > > + take use of hardware performance monitor to profiling the kernel
> > > + and application.
> > > +
> > > + If unsure, say N.
> > > +
> > > config KPROBES
> > >
> >
> > Mathieu Desnoyers
>
> 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
>

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

2007-12-29 06:14:05

by Robin Getz

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

On Fri 28 Dec 2007 14:28, Mathieu Desnoyers pondered:
> * Adrian Bunk ([email protected]) wrote:
> > On Fri, Dec 28, 2007 at 02:14:04PM -0500, Mathieu Desnoyers wrote:
> > > * Adrian Bunk ([email protected]) wrote:
> > > > This patch restores the blackfin Hardware Performance Monitor Profiling
> > > > support that was killed by
> > > > commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
> > > >
> > > > Signed-off-by: Adrian Bunk <[email protected]>
> > > >
> > >
> > > Yep, this one too must be put back, but kernel/Kconfig.instrumentation
> > > seems like the wrong spot for a blackfin-specific config option (and
> > > this will break the instrumentation menu removal patches in -mm).
> > >
> > > Can we put this in arch/blackfin/Kconfig instead ?
> >
> > No, this is a user visible option that belongs into the same menu as
> > "Profling support".
> >
>
> Actually, I wonder why these options exist at all rather than being on
> by default when profiling is enabled. There is no such thing as
> "activating the performance monitor profiling" on other architectures.
> What is so special about blackfin that makes it need it ?

This is probably more historical, and you are correct - it should just be part of profiling.


> > > > ---
> > > >
> > > > kernel/Kconfig.instrumentation | 9 +++++++++
> > > > 1 file changed, 9 insertions(+)
> > > >
> > > > 942996f33f81726c5edb012d61ecdad70c55884d
> > > > diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
> > > > index 97c76ca..e023671 100644
> > > > --- a/kernel/Kconfig.instrumentation
> > > > +++ b/kernel/Kconfig.instrumentation
> > > > @@ -44,2 +44,11 @@ config OPROFILE_MPCORE
> > > >
> > > > +config HARDWARE_PM
> > > > + tristate "Hardware Performance Monitor Profiling"
> > > > + depends on BLACKFIN && PROFILING
> > > > + help
> > > > + take use of hardware performance monitor to profiling the kernel
> > > > + and application.
> > > > +
> > > > + If unsure, say N.
> > > > +
> > > > config KPROBES
> > > >
> > >
> > > Mathieu Desnoyers
> >
> > 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
> >
>

2007-12-29 06:28:43

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

* Robin Getz ([email protected]) wrote:
> On Fri 28 Dec 2007 14:28, Mathieu Desnoyers pondered:
> > * Adrian Bunk ([email protected]) wrote:
> > > On Fri, Dec 28, 2007 at 02:14:04PM -0500, Mathieu Desnoyers wrote:
> > > > * Adrian Bunk ([email protected]) wrote:
> > > > > This patch restores the blackfin Hardware Performance Monitor Profiling
> > > > > support that was killed by
> > > > > commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
> > > > >
> > > > > Signed-off-by: Adrian Bunk <[email protected]>
> > > > >
> > > >
> > > > Yep, this one too must be put back, but kernel/Kconfig.instrumentation
> > > > seems like the wrong spot for a blackfin-specific config option (and
> > > > this will break the instrumentation menu removal patches in -mm).
> > > >
> > > > Can we put this in arch/blackfin/Kconfig instead ?
> > >
> > > No, this is a user visible option that belongs into the same menu as
> > > "Profling support".
> > >
> >
> > Actually, I wonder why these options exist at all rather than being on
> > by default when profiling is enabled. There is no such thing as
> > "activating the performance monitor profiling" on other architectures.
> > What is so special about blackfin that makes it need it ?
>
> This is probably more historical, and you are correct - it should just be part of profiling.
>

Ok, and do we really need to make HARDWARE_PM a tristate ? I see that
part of it must be compiled into the kernel in core .S files. Does it
really make sense for it to be a module ?

Also, op_model_bf533.c sits in the arch/blackfin/oprofile directory,
(built if HARDWARE_PM is y or m) but depends on PROFILING, not OPROFILE.
Is HARDWARE_PM useful at all without OPROFILE ?

>
> > > > > ---
> > > > >
> > > > > kernel/Kconfig.instrumentation | 9 +++++++++
> > > > > 1 file changed, 9 insertions(+)
> > > > >
> > > > > 942996f33f81726c5edb012d61ecdad70c55884d
> > > > > diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
> > > > > index 97c76ca..e023671 100644
> > > > > --- a/kernel/Kconfig.instrumentation
> > > > > +++ b/kernel/Kconfig.instrumentation
> > > > > @@ -44,2 +44,11 @@ config OPROFILE_MPCORE
> > > > >
> > > > > +config HARDWARE_PM
> > > > > + tristate "Hardware Performance Monitor Profiling"
> > > > > + depends on BLACKFIN && PROFILING
> > > > > + help
> > > > > + take use of hardware performance monitor to profiling the kernel
> > > > > + and application.
> > > > > +
> > > > > + If unsure, say N.
> > > > > +
> > > > > config KPROBES
> > > > >
> > > >
> > > > Mathieu Desnoyers
> > >
> > > 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
> > >
> >

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

2007-12-29 16:29:44

by Mathieu Desnoyers

[permalink] [raw]
Subject: [2.6.24 patch] Fix blackfin HARDWARE_PM support

(Robin, can you check if this patch does what is currently intended with
HARDWARE_PM please ? This involves testing with CONFIG_OPROFILE y/m/n.)

This patch restores the blackfin Hardware Performance Monitor Profiling
support that was killed by
commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.

Since there seems to be no good reason to behave differently from other
architectures, it now automatically selects the hardware performance counters
whenever the profiling is activated.

mach-common/irqpanic.c: pm_overflow
calls pm_overflow_handler which is in oprofile/op_model_bf533.c. I doubt that
setting HARDWARE_PM as "m" will work at all, since the pm_overflow_handler
should be in the core kernel image because it is called by irqpanic.c.

Therefore, I change HARDWARE_PM from a tristate to a bool.

The whole arch/$(ARCH)/oprofile/ is built depending on CONFIG_OPROFILE. Since
part of the HARDWARE_PM support files sits in this directory, it makes sense to
also depend on OPROFILE, not only PROFILING. Since OPROFILE already depends on
PROFILING, it is correct to only depend on OPROFILE only.

Signed-off-by: Mathieu Desnoyers <[email protected]>
CC: Adrian Bunk <[email protected]>
CC: Randy Dunlap <[email protected]>
CC: [email protected]
CC: Robin Getz <[email protected]>
---
arch/blackfin/Kconfig | 4 ++++
1 file changed, 4 insertions(+)

Index: linux-2.6-lttng/arch/blackfin/Kconfig
===================================================================
--- linux-2.6-lttng.orig/arch/blackfin/Kconfig 2007-12-29 11:00:05.000000000 -0500
+++ linux-2.6-lttng/arch/blackfin/Kconfig 2007-12-29 11:25:39.000000000 -0500
@@ -65,6 +65,10 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

+config HARDWARE_PM
+ def_bool y
+ depends on OPROFILE
+
source "init/Kconfig"
source "kernel/Kconfig.preempt"


--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68

2007-12-29 19:28:12

by Robin Getz

[permalink] [raw]
Subject: Re: [2.6.24 patch] restore blackfin HARDWARE_PM support

On Sat 29 Dec 2007 01:23, Mathieu Desnoyers pondered:
> Ok, and do we really need to make HARDWARE_PM a tristate ? I see that
> part of it must be compiled into the kernel in core .S files. Does it
> really make sense for it to be a module ?

I don't think so.

> Also, op_model_bf533.c sits in the arch/blackfin/oprofile directory,
> (built if HARDWARE_PM is y or m) but depends on PROFILING, not OPROFILE.
> Is HARDWARE_PM useful at all without OPROFILE ?

There was an out of tree patch that was floating around that gave people a sys
or proc interface to the hardware registers - since oprofile doesn't work
that well on a bash-less system.

I don't think I will have time to look at the patch over the weekend, but will
do after Jan 1.

-Robin

2008-01-02 17:52:21

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [2.6.24 patch] Fix blackfin HARDWARE_PM support

* Mathieu Desnoyers ([email protected]) wrote:
> (Robin, can you check if this patch does what is currently intended with
> HARDWARE_PM please ? This involves testing with CONFIG_OPROFILE y/m/n.)
>
> This patch restores the blackfin Hardware Performance Monitor Profiling
> support that was killed by
> commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9.
>
> Since there seems to be no good reason to behave differently from other
> architectures, it now automatically selects the hardware performance counters
> whenever the profiling is activated.
>
> mach-common/irqpanic.c: pm_overflow
> calls pm_overflow_handler which is in oprofile/op_model_bf533.c. I doubt that
> setting HARDWARE_PM as "m" will work at all, since the pm_overflow_handler
> should be in the core kernel image because it is called by irqpanic.c.
>
> Therefore, I change HARDWARE_PM from a tristate to a bool.
>
> The whole arch/$(ARCH)/oprofile/ is built depending on CONFIG_OPROFILE. Since
> part of the HARDWARE_PM support files sits in this directory, it makes sense to
> also depend on OPROFILE, not only PROFILING. Since OPROFILE already depends on
> PROFILING, it is correct to only depend on OPROFILE only.
>


This patch header should also include :

Problem identified by Adrian Bunk. Patch inspired by the original fix
proposed by him.

Thanks,

Mathieu


> Signed-off-by: Mathieu Desnoyers <[email protected]>
> CC: Adrian Bunk <[email protected]>
> CC: Randy Dunlap <[email protected]>
> CC: [email protected]
> CC: Robin Getz <[email protected]>
> ---
> arch/blackfin/Kconfig | 4 ++++
> 1 file changed, 4 insertions(+)
>
> Index: linux-2.6-lttng/arch/blackfin/Kconfig
> ===================================================================
> --- linux-2.6-lttng.orig/arch/blackfin/Kconfig 2007-12-29 11:00:05.000000000 -0500
> +++ linux-2.6-lttng/arch/blackfin/Kconfig 2007-12-29 11:25:39.000000000 -0500
> @@ -65,6 +65,10 @@ config GENERIC_CALIBRATE_DELAY
> bool
> default y
>
> +config HARDWARE_PM
> + def_bool y
> + depends on OPROFILE
> +
> source "init/Kconfig"
> source "kernel/Kconfig.preempt"
>
>
> --
> Mathieu Desnoyers
> Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68