Linux命令系列:perf 2019-09-01 GNULINUX►Command Command, Performance Tuning, RHEL Comments12345678910111213perf record -e cpu-clock -g -p pid#-g 选项是告诉perf record额外记录函数的调用关系#-e cpu-clock 指perf record监控的指标为cpu周期#-p 指定需要record的进程pidperf report -i perf.dataperf record -e cpu-clock -g -p pidperf script -i perf.data &> perf.unfoldgit clone https://github.com/brendangregg/FlameGraph --depth=1cd FlameGraph./stackcollapse-perf.pl ../perf.unfold &> ../perf.folded./flamegraph.pl ../perf.folded > ../perf.svg