性能分析

1.

perf record -e cycles -a -p 21028
perf report

 

2.

perf top 

 

3. perf top -p 21028

 

4. 以线程维度查看cpu使用率

top -d 1 -H

 

cmd:

perf record -e cpu-clock -g -p 21028
perf script -i perf.data &> perf.unfold
git clone https://github.com/brendangregg/FlameGraph.git
FlameGraph/stackcollapse-perf.pl perf.unfold &> perf.folded
export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
./FlameGraph/flamegraph.pl perf.folded > perf.svg
sz perf.svg
perf report -n --stdio

posted @ 2018-10-31 14:46  gavinhe  阅读(165)  评论(0编辑  收藏  举报