aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/power5-pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/power5-pmu.c')
-rw-r--r--arch/powerpc/kernel/power5-pmu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/power5-pmu.c b/arch/powerpc/kernel/power5-pmu.c
index 8694c73bfb52..29b2c6c0e83a 100644
--- a/arch/powerpc/kernel/power5-pmu.c
+++ b/arch/powerpc/kernel/power5-pmu.c
@@ -10,7 +10,9 @@
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/perf_counter.h> 12#include <linux/perf_counter.h>
13#include <linux/string.h>
13#include <asm/reg.h> 14#include <asm/reg.h>
15#include <asm/cputable.h>
14 16
15/* 17/*
16 * Bits in event code for POWER5 (not POWER5++) 18 * Bits in event code for POWER5 (not POWER5++)
@@ -599,7 +601,8 @@ static int power5_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
599 }, 601 },
600}; 602};
601 603
602struct power_pmu power5_pmu = { 604static struct power_pmu power5_pmu = {
605 .name = "POWER5",
603 .n_counter = 6, 606 .n_counter = 6,
604 .max_alternatives = MAX_ALT, 607 .max_alternatives = MAX_ALT,
605 .add_fields = 0x7000090000555ul, 608 .add_fields = 0x7000090000555ul,
@@ -612,3 +615,13 @@ struct power_pmu power5_pmu = {
612 .generic_events = power5_generic_events, 615 .generic_events = power5_generic_events,
613 .cache_events = &power5_cache_events, 616 .cache_events = &power5_cache_events,
614}; 617};
618
619static int init_power5_pmu(void)
620{
621 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5"))
622 return -ENODEV;
623
624 return register_power_pmu(&power5_pmu);
625}
626
627arch_initcall(init_power5_pmu);