Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Robin Murphy and committed by
Will Deacon
79448fa1 85c0dbd8

+2 -3
+2 -3
drivers/perf/arm_dsu_pmu.c
··· 284 284 unsigned long *used_mask = hw_events->used_mask; 285 285 286 286 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; 290 289 } 291 290 292 291 idx = find_first_zero_bit(used_mask, dsu_pmu->num_counters);