更新火焰图生成脚本

This commit is contained in:
luwenpeng
2023-05-31 14:37:02 +08:00
parent 124a06ba6a
commit 05df1e5c38
2 changed files with 5 additions and 12 deletions

View File

@@ -75,10 +75,10 @@ yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt install $append
#fi #fi
#git clone --depth 1 https://github.com/brendangregg/FlameGraph.git /opt/tools/FlameGraph/ #git clone --depth 1 https://github.com/brendangregg/FlameGraph.git /opt/tools/FlameGraph/
#git clone --depth 1 https://github.com/brendangregg/perf-tools.git /opt/tools/perf-tools/ #git clone --depth 1 https://github.com/brendangregg/perf-tools.git /opt/tools/perf-tools/
test -d "$target"/opt/tools/ || mkdir -p "$target"/opt/tools/ test -d "$target"/opt/tsg/tools/ || mkdir -p "$target"/opt/tsg/tools/
tar -zxf $projectdir/tools/FlameGraph.tar.gz -C "$target"/opt/tools/ tar -zxf $projectdir/tools/FlameGraph.tar.gz -C "$target"/opt/tsg/tools/
tar -zxf $projectdir/tools/perf-tools.tar.gz -C "$target"/opt/tools/ tar -zxf $projectdir/tools/perf-tools.tar.gz -C "$target"/opt/tsg/tools/
cp $projectdir/tools/run_flamegrah.sh "$target"/opt/tools/ cp $projectdir/tools/run_flamegrah.sh "$target"/opt/tsg/tools/
cat > "$target"/etc/sysconfig/network <<EOF cat > "$target"/etc/sysconfig/network <<EOF
NETWORKING=yes NETWORKING=yes

View File

@@ -57,13 +57,6 @@ rm -rf perf.svg
printf "\e[32m Convert data to flame graph\e[0m\n" printf "\e[32m Convert data to flame graph\e[0m\n"
# 用 perf script 工具对 perf.data 进行解析 perf script | /opt/tsg/tools/FlameGraph/stackcollapse-perf.pl | /opt/tsg/tools/FlameGraph/flamegraph.pl >perf.svg
perf script -i perf.data &> perf.unfold
# 将 perf.unfold 中的符号进行折叠
./FlameGraph/stackcollapse-perf.pl perf.unfold &> perf.folded
# 生成 svg 图
./FlameGraph/flamegraph.pl perf.folded > perf.svg
# 使用浏览器查看 perf.svg, 在浏览器中使用 Ctrl + F 进行关键字搜索 # 使用浏览器查看 perf.svg, 在浏览器中使用 Ctrl + F 进行关键字搜索