From 05df1e5c386565fff00cd2f618e9ce0c881dfb05 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Wed, 31 May 2023 14:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=81=AB=E7=84=B0=E5=9B=BE?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/mk-base-image | 8 ++++---- tools/run_flamegrah.sh | 9 +-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/tools/mk-base-image b/tools/mk-base-image index 48786d0c..450f1e24 100755 --- a/tools/mk-base-image +++ b/tools/mk-base-image @@ -75,10 +75,10 @@ yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt install $append #fi #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/ -test -d "$target"/opt/tools/ || mkdir -p "$target"/opt/tools/ -tar -zxf $projectdir/tools/FlameGraph.tar.gz -C "$target"/opt/tools/ -tar -zxf $projectdir/tools/perf-tools.tar.gz -C "$target"/opt/tools/ -cp $projectdir/tools/run_flamegrah.sh "$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/tsg/tools/ +tar -zxf $projectdir/tools/perf-tools.tar.gz -C "$target"/opt/tsg/tools/ +cp $projectdir/tools/run_flamegrah.sh "$target"/opt/tsg/tools/ cat > "$target"/etc/sysconfig/network < perf.unfold - -# 将 perf.unfold 中的符号进行折叠 -./FlameGraph/stackcollapse-perf.pl perf.unfold &> perf.folded - -# 生成 svg 图 -./FlameGraph/flamegraph.pl perf.folded > perf.svg +perf script | /opt/tsg/tools/FlameGraph/stackcollapse-perf.pl | /opt/tsg/tools/FlameGraph/flamegraph.pl >perf.svg # 使用浏览器查看 perf.svg, 在浏览器中使用 Ctrl + F 进行关键字搜索