diff options
author | Paul Mackerras <paulus@samba.org> | 2009-06-11 00:55:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-11 10:48:37 -0400 |
commit | 106b506c3a8b74daa5751e83ed3e46438fcf9a52 (patch) | |
tree | ad141aa86b020501823c7e2c7ac0abb9f27cf5a1 /arch/powerpc/kernel/power5+-pmu.c | |
parent | 4da52960fd1ae3ddd14901bc88b608cbeaa4b9a6 (diff) |
perf_counter: powerpc: Implement generalized cache events for POWER processors
This adds tables of event codes for the generalized cache events for
all the currently supported powerpc processors: POWER{4,5,5+,6,7} and
PPC970*, plus powerpc-specific code to use these tables when a
generalized cache event is requested.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <18992.36430.933526.742969@drongo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/kernel/power5+-pmu.c')
-rw-r--r-- | arch/powerpc/kernel/power5+-pmu.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/power5+-pmu.c b/arch/powerpc/kernel/power5+-pmu.c index 8471e3c2e465..bbf2cbb07388 100644 --- a/arch/powerpc/kernel/power5+-pmu.c +++ b/arch/powerpc/kernel/power5+-pmu.c | |||
@@ -614,6 +614,46 @@ static int power5p_generic_events[] = { | |||
614 | [PERF_COUNT_BRANCH_MISSES] = 0x230e5, /* BR_MPRED_CR */ | 614 | [PERF_COUNT_BRANCH_MISSES] = 0x230e5, /* BR_MPRED_CR */ |
615 | }; | 615 | }; |
616 | 616 | ||
617 | #define C(x) PERF_COUNT_HW_CACHE_##x | ||
618 | |||
619 | /* | ||
620 | * Table of generalized cache-related events. | ||
621 | * 0 means not supported, -1 means nonsensical, other values | ||
622 | * are event codes. | ||
623 | */ | ||
624 | static int power5p_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { | ||
625 | [C(L1D)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
626 | [C(OP_READ)] = { 0x1c10a8, 0x3c1088 }, | ||
627 | [C(OP_WRITE)] = { 0x2c10a8, 0xc10c3 }, | ||
628 | [C(OP_PREFETCH)] = { 0xc70e7, -1 }, | ||
629 | }, | ||
630 | [C(L1I)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
631 | [C(OP_READ)] = { 0, 0 }, | ||
632 | [C(OP_WRITE)] = { -1, -1 }, | ||
633 | [C(OP_PREFETCH)] = { 0, 0 }, | ||
634 | }, | ||
635 | [C(L2)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
636 | [C(OP_READ)] = { 0, 0 }, | ||
637 | [C(OP_WRITE)] = { 0, 0 }, | ||
638 | [C(OP_PREFETCH)] = { 0xc50c3, 0 }, | ||
639 | }, | ||
640 | [C(DTLB)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
641 | [C(OP_READ)] = { 0xc20e4, 0x800c4 }, | ||
642 | [C(OP_WRITE)] = { -1, -1 }, | ||
643 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
644 | }, | ||
645 | [C(ITLB)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
646 | [C(OP_READ)] = { 0, 0x800c0 }, | ||
647 | [C(OP_WRITE)] = { -1, -1 }, | ||
648 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
649 | }, | ||
650 | [C(BPU)] = { /* RESULT_ACCESS RESULT_MISS */ | ||
651 | [C(OP_READ)] = { 0x230e4, 0x230e5 }, | ||
652 | [C(OP_WRITE)] = { -1, -1 }, | ||
653 | [C(OP_PREFETCH)] = { -1, -1 }, | ||
654 | }, | ||
655 | }; | ||
656 | |||
617 | struct power_pmu power5p_pmu = { | 657 | struct power_pmu power5p_pmu = { |
618 | .n_counter = 6, | 658 | .n_counter = 6, |
619 | .max_alternatives = MAX_ALT, | 659 | .max_alternatives = MAX_ALT, |
@@ -623,8 +663,9 @@ struct power_pmu power5p_pmu = { | |||
623 | .get_constraint = power5p_get_constraint, | 663 | .get_constraint = power5p_get_constraint, |
624 | .get_alternatives = power5p_get_alternatives, | 664 | .get_alternatives = power5p_get_alternatives, |
625 | .disable_pmc = power5p_disable_pmc, | 665 | .disable_pmc = power5p_disable_pmc, |
666 | .limited_pmc_event = power5p_limited_pmc_event, | ||
667 | .flags = PPMU_LIMITED_PMC5_6, | ||
626 | .n_generic = ARRAY_SIZE(power5p_generic_events), | 668 | .n_generic = ARRAY_SIZE(power5p_generic_events), |
627 | .generic_events = power5p_generic_events, | 669 | .generic_events = power5p_generic_events, |
628 | .flags = PPMU_LIMITED_PMC5_6, | 670 | .cache_events = &power5p_cache_events, |
629 | .limited_pmc_event = power5p_limited_pmc_event, | ||
630 | }; | 671 | }; |