下载仓库 git clone https://github.com/brendangregg/FlameGraph.git
- perf -a -g -p [pid] (-a 采集所有cpu -g 采集堆栈)
- perf script -i perf.data &> perf.unfold (解析perf.data)
- ./stackcollapse-perf.pl perf.unfold > perf.folded (折叠符号)
- ./flamegraph.pl perf.folded > perf.svg (生成火焰图)