]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf/arm-cmn: Make cycle counts less surprising
authorRobin Murphy <robin.murphy@arm.com>
Mon, 2 Sep 2024 17:52:01 +0000 (18:52 +0100)
committerWill Deacon <will@kernel.org>
Wed, 4 Sep 2024 15:04:08 +0000 (16:04 +0100)
commitc5b15ddf11a8a82f5e9ccd9b44f7b765c59bffdd
tree5c5260ccb2a8147141cd99dde807bd69246cce6d
parentff436cee694ee8bc4173f2d42622ee7c17a085d3
perf/arm-cmn: Make cycle counts less surprising

By default, CMN has automatic clock-gating with the implication that
a DTC's cycle counter may not increment while the DTC is sufficiently
idle. Given that we may have up to 4 DTCs to choose from when scheduling
a cycles event, this may potentially lead to surprising results if
trying to measure metrics based on activity in a different DTC domain
from where cycles end up being counted. Furthermore, since the details
of internal clock gating are not documented, we can't even reason about
what "active" cycles for a DTC actually mean relative to the activity of
other nodes within the same nominal DTC domain.

Make the reasonable assumption that if the user wants to count cycles,
they almost certainly want to count all of the cycles, and disable clock
gating while a DTC's cycle counter is in use.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/c47cfdc09e907b1d7753d142a7e659982cceb246.1725296395.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c