diff options
Diffstat (limited to 'arch/powerpc/kernel/power6-pmu.c')
-rw-r--r-- | arch/powerpc/kernel/power6-pmu.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/power6-pmu.c b/arch/powerpc/kernel/power6-pmu.c index 8898622ac28..09ae5bf5bda 100644 --- a/arch/powerpc/kernel/power6-pmu.c +++ b/arch/powerpc/kernel/power6-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 POWER6 | 18 | * Bits in event code for POWER6 |
@@ -516,7 +518,8 @@ static int power6_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { | |||
516 | }, | 518 | }, |
517 | }; | 519 | }; |
518 | 520 | ||
519 | struct power_pmu power6_pmu = { | 521 | static struct power_pmu power6_pmu = { |
522 | .name = "POWER6", | ||
520 | .n_counter = 6, | 523 | .n_counter = 6, |
521 | .max_alternatives = MAX_ALT, | 524 | .max_alternatives = MAX_ALT, |
522 | .add_fields = 0x1555, | 525 | .add_fields = 0x1555, |
@@ -531,3 +534,13 @@ struct power_pmu power6_pmu = { | |||
531 | .generic_events = power6_generic_events, | 534 | .generic_events = power6_generic_events, |
532 | .cache_events = &power6_cache_events, | 535 | .cache_events = &power6_cache_events, |
533 | }; | 536 | }; |
537 | |||
538 | static int init_power6_pmu(void) | ||
539 | { | ||
540 | if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6")) | ||
541 | return -ENODEV; | ||
542 | |||
543 | return register_power_pmu(&power6_pmu); | ||
544 | } | ||
545 | |||
546 | arch_initcall(init_power6_pmu); | ||