定位进程运行的cpu:
ps -o pid,psr,comm -p `pidof testd`
查看cpu1热点:
perf top -C 1
查看当前cpu的系统调用:
perf trace -C 1 --syscalls --call-graph dwarf
查看cache-misses:
perf top -C 1 -e cache-misses
记录多个cpu抽样数据:
perf record -C 1-n
读取perf记录的数据:
perf report
本文介绍如何使用各种命令来定位和分析CPU性能问题,包括进程运行的CPU定位、热点查看、系统调用跟踪、缓存缺失统计及多CPU抽样数据记录等方法。
定位进程运行的cpu:
ps -o pid,psr,comm -p `pidof testd`
查看cpu1热点:
perf top -C 1
查看当前cpu的系统调用:
perf trace -C 1 --syscalls --call-graph dwarf
查看cache-misses:
perf top -C 1 -e cache-misses
记录多个cpu抽样数据:
perf record -C 1-n
读取perf记录的数据:
perf report
1094
545
1132

被折叠的 条评论
为什么被折叠?