Invalid event (cycles:pp) in per-thread mode, enable system wide with '-a'.

From: Nick Desaulniers
Date: Thu Sep 29 2022 - 17:54:30 EST


So I recently moved from a dual-xeon box to a zen 2 based threadripper
workstation.

My usual incantation for measuring profiles for compile time isn't working:

$ perf record -e cycles:pp --freq=128 --call-graph lbr -- make LLVM=1 -j$(nproc)
Error:
Invalid event (cycles:pp) in per-thread mode, enable system wide with '-a'.

I've already set /proc/sys/kernel/perf_event_paranoid and
/proc/sys/kernel/kptr_restrict to 0.

I remember hearing rumblings about issues with zen 2, LBR, vs zen 3.
Is this a known issue, or am I holding it wrong?
--
Thanks,
~Nick Desaulniers