summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2021-07-14 09:21:56 +0800
committerluwenpeng <[email protected]>2021-07-14 09:21:56 +0800
commit5b13adbf7ef328a7c58ae6e0caa8369b720dd965 (patch)
tree05a40f91dcc8b7b0bac5d90cb37ad5761e541cd7
Add FlameGraph
-rw-r--r--FlameGraph/FlameGraph-master.zipbin0 -> 1122442 bytes
-rw-r--r--FlameGraph/run_flamegrap.sh12
2 files changed, 12 insertions, 0 deletions
diff --git a/FlameGraph/FlameGraph-master.zip b/FlameGraph/FlameGraph-master.zip
new file mode 100644
index 0000000..a45e567
--- /dev/null
+++ b/FlameGraph/FlameGraph-master.zip
Binary files differ
diff --git a/FlameGraph/run_flamegrap.sh b/FlameGraph/run_flamegrap.sh
new file mode 100644
index 0000000..dddd207
--- /dev/null
+++ b/FlameGraph/run_flamegrap.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [ ! -n "$1" ] ;then
+ echo "Please input pid !"
+ exit 0
+fi
+
+rm -rf perf.data out.perf-folded result.svg
+
+perf record -F 99 -p $1 -g -- sleep 10
+perf script | FlameGraph-master/stackcollapse-perf.pl > out.perf-folded
+FlameGraph-master/flamegraph.pl out.perf-folded > result.svg