# 问题 使用普通用户执行perf top命令通常无法执行,报告以下错误(You may not have permission to collect system-wide stats ...): ![image](../../../../../ff_internal_upload/img/2021/image-20210204140246717.png) # 解决方法 临时修改方法1: ```bash sudo sh -c 'echo 1 > /proc/sys/kernel/perf_event_paranoid' ``` 临时修改方法2: ```bash sudo sysctl -w kernel.perf_event_paranoid=1 ``` 为例重启之后有效,创建一个 /etc/sysctl.d/99-mysettings.conf 文件,内容如下: ```bash kernel.perf_event_paranoid=1 ``` # 参考 - [Run perf without root-rights](https://superuser.com/questions/980632/run-perf-without-root-rights) - [perf top命令出现“You may not have permission to collect system-wide stats.](https://www.likai.show/index.php/archives/23/)