I am trying to collect some data using perf, but whenever I try perf, I get the "You may not have permission to collect stats.", error.

I have tried changing the /proc/sys/kernel/perf_event_paranoid value to -1; but each time it miraculously resets to "3".

I am using Ubuntu 18.04 LTS.

1 Answer 1


It turned out, for some reason the system just didn't want me to change the kernel.perf_event_paranoid, while in session.

So I ran

sudo sh -c 'echo kernel.perf_event_paranoid=1 > /etc/sysctl.d/local.conf'

and rebooted the system and now it works like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.