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.