|
mkdir /data/perf
cd /data/perf
perf record -g --call-graph fp -F 99 -p $(pidof xxx) -- sleep 30
准备FlameGraph生成工具
git clone https://github.com/brendangregg/FlameGraph
cd FlameGraph
mkdir -p $HOME/.local/bin
cp stackcollapse-perf.pl $HOME/.local/bin/
cp flamegraph.pl $HOME/.local/bin/
export PATH=$HOME/.local/bin:$PATH进入到perf.data相同目录执行sudo perf script | /home/god/xxx/FlameGraph/stackcollapse-perf.pl| /home/god/xxx/FlameGraph/flamegraph.pl > flame.svg