Skip to content

Commit 79448fa

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm_dsu: Allow standard cycles events
Since we do not use the divide-by-64 option, there should be no significant difference between the dedicated cycle counter and the standard cycles event. Since using the latter on DSU-120 now has the side-effect of allowing multiple cycles events to be scheduled simultaneously (beneficial for multiple cycle-based metrics), there seems little reason not to allow the same on older DSUs as well. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 85c0dbd commit 79448fa

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/perf/arm_dsu_pmu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ static int dsu_pmu_get_event_idx(struct dsu_hw_events *hw_events,
284284
unsigned long *used_mask = hw_events->used_mask;
285285

286286
if (evtype == DSU_PMU_EVT_CYCLES && dsu_pmu->has_pmccntr) {
287-
if (test_and_set_bit(DSU_PMU_IDX_CYCLE_COUNTER, used_mask))
288-
return -EAGAIN;
289-
return DSU_PMU_IDX_CYCLE_COUNTER;
287+
if (!test_and_set_bit(DSU_PMU_IDX_CYCLE_COUNTER, used_mask))
288+
return DSU_PMU_IDX_CYCLE_COUNTER;
290289
}
291290

292291
idx = find_first_zero_bit(used_mask, dsu_pmu->num_counters);

0 commit comments

Comments
 (0)