linux perf top分析系统性能
1,看到内核宏是否支持perf功能
perf top -g
查看linux 内核宏定义
CONFIG_PERF_EVENTS=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_FRAME_POINTER=y # 确保帧指针支持以捕获完整堆栈
2,使用perf top -g 报错
Access to performance monitoring and observability operations is limited. │
│Consider adjusting /proc/sys/kernel/perf_event_paranoid setting to open │
│access to performance monitoring and observability operations for processes│
│without CAP_PERFMON, CAP_SYS_PTRACE or CAP_SYS_ADMIN Linux capability. |
│More information can be found at 'Perf events and tool security' document: │
│https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html