File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # For svg graph download https://github.com/brendangregg/FlameGraph
4
- # and run `FlameGraph/stackcollapse-perf.pl profdata.txt | FlameGraph/flamegraph.pl > profdata.svg`
3
+ set -eux
5
4
6
- pid =$( pgrep -u $USER kqprun)
5
+ kqprun_pid =$( pgrep -u $USER kqprun)
7
6
8
- echo " Target process id: ${pid} "
9
-
10
- sudo perf record -F 50 --call-graph dwarf -g --proc-map-timeout=10000 --pid $pid -v -o profdata -- sleep 30
7
+ sudo perf record -F 50 --call-graph dwarf -g --proc-map-timeout=10000 --pid $kqprun_pid -v -o profdata -- sleep ${1:- ' 30' }
11
8
sudo perf script -i profdata > profdata.txt
9
+
10
+ flame_graph_tool=" ../../../../contrib/tools/flame-graph/"
11
+
12
+ ${flame_graph_tool} /stackcollapse-perf.pl profdata.txt | ${flame_graph_tool} /flamegraph.pl > profdata.svg
You can’t perform that action at this time.
0 commit comments