Conflict when accessing PMU counters from userspace

Mark Rutland mark.rutland at
Fri Sep 8 03:28:06 PDT 2017

On Thu, Sep 07, 2017 at 12:36:48PM -0700, Jason Teplitz wrote:
> Hello,


> I'm reading the PMU counters from a userspace process, but the cycle
> counter keeps getting reset. I don't believe any other running
> processes are doing this. Is there something in the kernel that resets
> the cycle counter periodically and if so is there an easy way to
> disable it?

Reading the PMU counters directly from userspace is not supported, and
we configure the CPU to trap such accesses.

Ignoring explicit reset of the counters, there are a number of reasons
why you will not see consistent values from userspace.

Which kernel are you using (e.g. version? arm/arm64?), and how have you
enabled userspace access?


More information about the linux-arm-kernel mailing list