Re: [PATCH V2 1/8] perf: Add PERF_SAMPLE_PHYS_ADDR

From: Peter Zijlstra
Date: Tue Jan 19 2016 - 11:30:37 EST


On Thu, Jan 07, 2016 at 08:30:33AM -0500, kan.liang@xxxxxxxxx wrote:
> From: Kan Liang <kan.liang@xxxxxxxxx>
>
> For understanding how the workload maps to memory channels and hardware
> behavior, it's useful to collect address maps with physical addresses.
> This is not intended for detecting page sharing (which can be already
> done using the mmap inode), but for lower level hardware behavior
> studies.

This patch set completely lacks any useful example for why we should
entertain this.

> @@ -8269,6 +8275,11 @@ SYSCALL_DEFINE5(perf_event_open,
> return -EINVAL;
> }
>
> + /* Only privileged users can get kernel addresses */
> + if ((attr.sample_type & PERF_SAMPLE_PHYS_ADDR) &&
> + !capable(CAP_SYS_ADMIN))
> + return -EACCES;
> +

should that not also include a perf_paranoid_kernel() test?