Unable to change kernel.perf_event_paranoid

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

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like