V N
V N

Reputation: 21

How do I enable access to the pmu counter?

How do I enable access to the pmu counter?

The target is an arm64-v8 android device. I do not have the android kernel source, just the headers in the android ndk

The function below does not work unless the pmu counter is readable from user space.

static inline uint64_t
read_pmccntr(void)
{
    uint64_t val;
    asm volatile("mrs %0, pmccntr_el0" : "=r"(val));
    return val;
}

basically I have to insmod a kernel module that enables this. I have been trying to build a kernel module to do this, but I don't have the android kernel source. Also, would I just compile the kernel module into an object file? Any help is appreciated

Upvotes: 0

Views: 27

Answers (0)

Related Questions