aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2013-07-23 04:07:45 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-07-31 23:11:46 -0400
commit8d7c55d01e4648605fd0dacc82d8d3989ead4db7 (patch)
tree852d175f0ddb5e40d7855fb57f7bc072f527e2b1 /arch/powerpc/perf
parente8e813ed268d90c1377f53460527c419eb52c67a (diff)
powerpc/perf: Export PERF_EVENT_CONFIG_EBB_SHIFT to userspace
We use bit 63 of the event code for userspace to request that the event be counted using EBB (Event Based Branches). Export this value, making it part of the API - though only on processors that support EBB. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/core-book3s.c2
-rw-r--r--arch/powerpc/perf/power8-pmu.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 24a45f91c65f..eeae308cf982 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -484,7 +484,7 @@ static bool is_ebb_event(struct perf_event *event)
484 * use bit 63 of the event code for something else if they wish. 484 * use bit 63 of the event code for something else if they wish.
485 */ 485 */
486 return (ppmu->flags & PPMU_EBB) && 486 return (ppmu->flags & PPMU_EBB) &&
487 ((event->attr.config >> EVENT_CONFIG_EBB_SHIFT) & 1); 487 ((event->attr.config >> PERF_EVENT_CONFIG_EBB_SHIFT) & 1);
488} 488}
489 489
490static int ebb_event_check(struct perf_event *event) 490static int ebb_event_check(struct perf_event *event)
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 7466374d2787..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)