-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa4e3d5
commit 29b60bf
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# For svg graph download https://github.com/brendangregg/FlameGraph | ||
# and run `FlameGraph/stackcollapse-perf.pl profdata.txt | FlameGraph/flamegraph.pl > profdata.svg` | ||
set -eux | ||
|
||
pid=$(pgrep -u $USER kqprun) | ||
kqprun_pid=$(pgrep -u $USER kqprun) | ||
|
||
echo "Target process id: ${pid}" | ||
|
||
sudo perf record -F 50 --call-graph dwarf -g --proc-map-timeout=10000 --pid $pid -v -o profdata -- sleep 30 | ||
sudo perf record -F 50 --call-graph dwarf -g --proc-map-timeout=10000 --pid $kqprun_pid -v -o profdata -- sleep ${1:-'30'} | ||
sudo perf script -i profdata > profdata.txt | ||
|
||
flame_graph_tool="../../../../contrib/tools/flame-graph/" | ||
|
||
${flame_graph_tool}/stackcollapse-perf.pl profdata.txt | ${flame_graph_tool}/flamegraph.pl > profdata.svg |