summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorRohit Gupta <rohgup@codeaurora.org>2015-08-05 19:41:49 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:48:22 -0700
commitfbde2216f242be105f9d28aeafcb44236d5da557 (patch)
treeb2f8460f2cfa2284a2adb4d21dd79d7ab5ad4c02 /arch/arm64/kernel
parentc736e7fda560e2844cb6bbd92b392f0c9a66e9f2 (diff)
perf: Allow multiple cycle count requests
Use existing avaialble PMU counters if there are multiple requests for counting CPU cycles. Change-Id: Icc3a7a5859ef60ab56ffcb1339e3734c3885ede2 Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/perf_event.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 8f466a07ee5f..992f2837cea4 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -514,12 +514,10 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc,
struct hw_perf_event *hwc = &event->hw;
unsigned long evtype = hwc->config_base & ARMV8_EVTYPE_EVENT;
- /* Always place a cycle counter into the cycle counter. */
+ /* Place the first cycle counter request into the cycle counter. */
if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) {
- if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask))
- return -EAGAIN;
-
- return ARMV8_IDX_CYCLE_COUNTER;
+ if (!test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask))
+ return ARMV8_IDX_CYCLE_COUNTER;
}
/*