perf_event_paranoid and PMU counter trust in virtualized Linux hosts
0 reputation · 10 Mar 2023, 00:19 UTC
Measuring a CPU or hardware-counter bottleneck before optimization requires consistent perf data across environments.
perf_event_paranoid governs which users may access hardware PMU events, creating a permission boundary for unprivileged profiling. In virtualized hosts the availability and fidelity of PMU counters is not uniform, leaving uncertainty about whether hardware events reflect the guest workload or are virtualized, multiplexed, or unavailable.
The goal is to define a measurement approach that respects the permission boundary while acknowledging the unresolved behavior of counter accuracy in VMs.
What measurement capabilities remain for an unprivileged user when perf_event_paranoid restricts hardware PMU access? How does the kernel expose differences in counter availability between bare metal and a virtualized host? When PMU virtualization is uncertain, which perf event classes remain comparable across hosts for bottleneck triage?