diff options
Diffstat (limited to 'arch/powerpc/perf/power8-pmu.c')
-rw-r--r-- | arch/powerpc/perf/power8-pmu.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index 96a64d6a8bdf..2ee4a707f0df 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
@@ -118,7 +118,7 @@ | |||
118 | (EVENT_UNIT_MASK << EVENT_UNIT_SHIFT) | \ | 118 | (EVENT_UNIT_MASK << EVENT_UNIT_SHIFT) | \ |
119 | (EVENT_COMBINE_MASK << EVENT_COMBINE_SHIFT) | \ | 119 | (EVENT_COMBINE_MASK << EVENT_COMBINE_SHIFT) | \ |
120 | (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT) | \ | 120 | (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT) | \ |
121 | (EVENT_EBB_MASK << EVENT_CONFIG_EBB_SHIFT) | \ | 121 | (EVENT_EBB_MASK << PERF_EVENT_CONFIG_EBB_SHIFT) | \ |
122 | EVENT_PSEL_MASK) | 122 | EVENT_PSEL_MASK) |
123 | 123 | ||
124 | /* MMCRA IFM bits - POWER8 */ | 124 | /* MMCRA IFM bits - POWER8 */ |
@@ -233,10 +233,10 @@ static int power8_get_constraint(u64 event, unsigned long *maskp, unsigned long | |||
233 | pmc = (event >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; | 233 | pmc = (event >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; |
234 | unit = (event >> EVENT_UNIT_SHIFT) & EVENT_UNIT_MASK; | 234 | unit = (event >> EVENT_UNIT_SHIFT) & EVENT_UNIT_MASK; |
235 | cache = (event >> EVENT_CACHE_SEL_SHIFT) & EVENT_CACHE_SEL_MASK; | 235 | cache = (event >> EVENT_CACHE_SEL_SHIFT) & EVENT_CACHE_SEL_MASK; |
236 | ebb = (event >> EVENT_CONFIG_EBB_SHIFT) & EVENT_EBB_MASK; | 236 | ebb = (event >> PERF_EVENT_CONFIG_EBB_SHIFT) & EVENT_EBB_MASK; |
237 | 237 | ||
238 | /* Clear the EBB bit in the event, so event checks work below */ | 238 | /* Clear the EBB bit in the event, so event checks work below */ |
239 | event &= ~(EVENT_EBB_MASK << EVENT_CONFIG_EBB_SHIFT); | 239 | event &= ~(EVENT_EBB_MASK << PERF_EVENT_CONFIG_EBB_SHIFT); |
240 | 240 | ||
241 | if (pmc) { | 241 | if (pmc) { |
242 | if (pmc > 6) | 242 | if (pmc > 6) |
@@ -561,18 +561,13 @@ static int power8_generic_events[] = { | |||
561 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) | 561 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) |
562 | { | 562 | { |
563 | u64 pmu_bhrb_filter = 0; | 563 | u64 pmu_bhrb_filter = 0; |
564 | u64 br_privilege = branch_sample_type & ONLY_PLM; | ||
565 | 564 | ||
566 | /* BHRB and regular PMU events share the same prvillege state | 565 | /* BHRB and regular PMU events share the same privilege state |
567 | * filter configuration. BHRB is always recorded along with a | 566 | * filter configuration. BHRB is always recorded along with a |
568 | * regular PMU event. So privilege state filter criteria for BHRB | 567 | * regular PMU event. As the privilege state filter is handled |
569 | * and the companion PMU events has to be the same. As a default | 568 | * in the basic PMC configuration of the accompanying regular |
570 | * "perf record" tool sets all privillege bits ON when no filter | 569 | * PMU event, we ignore any separate BHRB specific request. |
571 | * criteria is provided in the command line. So as along as all | ||
572 | * privillege bits are ON or they are OFF, we are good to go. | ||
573 | */ | 570 | */ |
574 | if ((br_privilege != 7) && (br_privilege != 0)) | ||
575 | return -1; | ||
576 | 571 | ||
577 | /* No branch filter requested */ | 572 | /* No branch filter requested */ |
578 | if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY) | 573 | if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY) |
@@ -621,10 +616,19 @@ static struct power_pmu power8_pmu = { | |||
621 | 616 | ||
622 | static int __init init_power8_pmu(void) | 617 | static int __init init_power8_pmu(void) |
623 | { | 618 | { |
619 | int rc; | ||
620 | |||
624 | if (!cur_cpu_spec->oprofile_cpu_type || | 621 | if (!cur_cpu_spec->oprofile_cpu_type || |
625 | strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8")) | 622 | strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8")) |
626 | return -ENODEV; | 623 | return -ENODEV; |
627 | 624 | ||
628 | return register_power_pmu(&power8_pmu); | 625 | rc = register_power_pmu(&power8_pmu); |
626 | if (rc) | ||
627 | return rc; | ||
628 | |||
629 | /* Tell userspace that EBB is supported */ | ||
630 | cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB; | ||
631 | |||
632 | return 0; | ||
629 | } | 633 | } |
630 | early_initcall(init_power8_pmu); | 634 | early_initcall(init_power8_pmu); |