Skip to contentSkip to conversation

restore blackfin HARDWARE_PM support

PATCH In review Adrian Bunk 4 participants 9 messages Dec 28, 2007 – Jan 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 restore blackfin HARDWARE_PM support

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

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +9 -0
index 97c76ca..e023671 100644
@@ -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
#1 lore raw
Quoted 6 lines · * Adrian Bunk ([email protected]) wrote:

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

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 ?

Quoted 23 lines

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +9 -0
index 97c76ca..e023671 100644
@@ -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
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#2 lore raw
Quoted 5 lines · Mathieu Desnoyers
Quoted 4 lines · * Adrian Bunk ([email protected]) wrote:

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

Quoted 8 lines
Quoted 2 lines

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

Quoted 12 lines
Quoted 12 lines

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +0 -0
index 97c76ca..e023671 100644
@@ -44,2 +44,11 @@ config OPROFILE_MPCORE
 
Quoted 13 lines

kernel/Kconfig.instrumentation config OPROFILE_MPCORE · line 54

Quoted 11 lines
kernel/Kconfig.instrumentation +9 -0
+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

Signature · 4 lines
       "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
#3 lore raw
Quoted 9 lines · * Adrian Bunk ([email protected]) wrote:
Quoted 8 lines · Mathieu Desnoyers
Quoted 6 lines · * Adrian Bunk ([email protected]) wrote:

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

Quoted 9 lines
Quoted 5 lines

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 ?

Quoted 36 lines
Quoted 12 lines
Quoted 12 lines

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +0 -0
index 97c76ca..e023671 100644
@@ -44,2 +44,11 @@ config OPROFILE_MPCORE
 
Quoted 13 lines

kernel/Kconfig.instrumentation config OPROFILE_MPCORE · line 54

Quoted 11 lines
kernel/Kconfig.instrumentation +9 -0
+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

Signature · 4 lines
       "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
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#4 lore raw

On Fri 28 Dec 2007 14:28, Mathieu Desnoyers pondered:

Quoted 16 lines · * Adrian Bunk ([email protected]) wrote:
Quoted 15 lines · Mathieu Desnoyers
Quoted 13 lines · * Adrian Bunk ([email protected]) wrote:
Quoted 6 lines

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

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 ?

Quoted 8 lines
Quoted 3 lines

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.

Quoted 37 lines
Quoted 36 lines
Quoted 12 lines
Quoted 12 lines

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +0 -0
index 97c76ca..e023671 100644
@@ -44,2 +44,11 @@ config OPROFILE_MPCORE
 
Quoted 13 lines

kernel/Kconfig.instrumentation config OPROFILE_MPCORE · line 54

Quoted 11 lines
kernel/Kconfig.instrumentation +9 -0
+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

Signature · 4 lines
       "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
#5 lore raw
Quoted 21 lines · * Robin Getz ([email protected]) wrote:

On Fri 28 Dec 2007 14:28, Mathieu Desnoyers pondered:

Quoted 20 lines · * Adrian Bunk ([email protected]) wrote:
Quoted 18 lines · Mathieu Desnoyers
Quoted 5 lines · * Adrian Bunk ([email protected]) wrote:
Quoted 4 lines

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

Quoted 8 lines
Quoted 2 lines

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

Quoted 7 lines
Quoted 4 lines

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 ?

Quoted 38 lines
Quoted 38 lines
Quoted 37 lines
Quoted 13 lines
Quoted 13 lines

---

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

942996f33f81726c5edb012d61ecdad70c55884d

kernel/Kconfig.instrumentation +0 -0
index 97c76ca..e023671 100644
@@ -44,2 +44,11 @@ config OPROFILE_MPCORE
 
Quoted 13 lines

kernel/Kconfig.instrumentation config OPROFILE_MPCORE · line 54

Quoted 11 lines
kernel/Kconfig.instrumentation +9 -0
+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

Signature · 4 lines
       "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
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#6 lore raw

On Sat 29 Dec 2007 01:23, Mathieu Desnoyers pondered:

Quoted 3 lines

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.

Quoted 3 lines

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

#7 lore raw

PATCH 1/1 Fix blackfin HARDWARE_PM support

In reply to Robin Getz

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

---
 arch/blackfin/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)
arch/blackfin/Kconfig +4 -0
Index: linux-2.6-lttng/arch/blackfin/Kconfig
===================================================================
@@ -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"
 
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#8 lore raw

Re: [2.6.24 patch] Fix blackfin HARDWARE_PM support

Quoted 16 lines · * 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.

Quoted 7 lines

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

Quoted 35 lines
---
 arch/blackfin/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6-lttng/arch/blackfin/Kconfig
===================================================================

arch/blackfin/Kconfig +4 -0
@@ -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"
 
Signature · 9 lines
-- 
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/
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68