Skip to contentSkip to conversation

perfcounters/powerpc: Add support for POWER5 processors

PATCH In review Paul Mackerras 2 participants 2 messages Feb 26, 2009 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perfcounters/powerpc: Add support for POWER5 processors

This adds the back-end for the PMU on the POWER5 processor. This knows how to use the fixed-function PMC5 and PMC6 (instructions completed and run cycles). Unlike POWER6, PMC5/6 obey the freeze conditions and can generate interrupts, so their use doesn't impose any extra restrictions.

POWER5+ is different and is not supported by this patch.

---
Ingo, please pull this from my perfcounters.git tree master branch at:

git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master

 arch/powerpc/kernel/Makefile       |    3 +-
 arch/powerpc/kernel/perf_counter.c |    4 +
 arch/powerpc/kernel/power5-pmu.c   |  475 ++++++++++++++++++++++++++++++++++++
 3 files changed, 481 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/kernel/power5-pmu.c
arch/powerpc/kernel/Makefile +2 -1
index 7c941ec..b4c6f46 100644
@@ -94,7 +94,8 @@ obj-$(CONFIG_AUDIT)		+= audit.o
 obj64-$(CONFIG_AUDIT)		+= compat_audit.o
 
 obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
-obj-$(CONFIG_PERF_COUNTERS)	+= perf_counter.o ppc970-pmu.o power6-pmu.o
+obj-$(CONFIG_PERF_COUNTERS)	+= perf_counter.o ppc970-pmu.o power5-pmu.o \
+				   power6-pmu.o
 
 obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
 
arch/powerpc/kernel/perf_counter.c +4 -0
index 6e27913..112332d 100644
@@ -824,6 +824,7 @@ void hw_perf_counter_setup(int cpu)
 }
 
 extern struct power_pmu ppc970_pmu;
+extern struct power_pmu power5_pmu;
 extern struct power_pmu power6_pmu;
 
 static int init_perf_counters(void)
@@ -843,6 +844,9 @@ static int init_perf_counters(void)
 	case PV_970MP:
 		ppmu = &ppc970_pmu;
 		break;
+	case PV_POWER5:
+		ppmu = &power5_pmu;
+		break;
 	case 0x3e:
 		ppmu = &power6_pmu;
 		break;
arch/powerpc/kernel/power5-pmu.c new file +475 -0

475 lines not on this page · raw message

Signature · 1 line
1.5.5.rc3.7.gba13
#1 lore raw
Quoted 11 lines · Paul Mackerras

This adds the back-end for the PMU on the POWER5 processor. This knows how to use the fixed-function PMC5 and PMC6 (instructions completed and run cycles). Unlike POWER6, PMC5/6 obey the freeze conditions and can generate interrupts, so their use doesn't impose any extra restrictions.

POWER5+ is different and is not supported by this patch.

---
Ingo, please pull this from my perfcounters.git tree master branch at:

Quoted 7 lines

git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master

 arch/powerpc/kernel/Makefile       |    3 +-
 arch/powerpc/kernel/perf_counter.c |    4 +
 arch/powerpc/kernel/power5-pmu.c   |  475 ++++++++++++++++++++++++++++++++++++
 3 files changed, 481 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/kernel/power5-pmu.c

Pulled into tip:perfcounters/core, thanks Paul!

Ingo