perf: Satisfy the kernel's request to request PMU counters
The SELinux policy on Android doesn't provide the kernel-space
with CAP_SYS_ADMIN capability. The perf-core checks for this
capability before giving access to the callers to read the PMU
counters. Hence, when the kernel drivers try to gain access
to the PMU (via perf_event_create_kernel_counter()), it fails
with -EACCES.
To get past this, add another condition to check if the request
is coming from kernel-space or user-space. If kernel-space,
don't check for the capability any further and move on.
Change-Id: Ie2ddc6b619fa0d60d4752994ea0c9cedf5b96b5c
Signed-off-by:
Raghavendra Rao Ananta <rananta@codeaurora.org>
Loading
Please register or sign in to comment