Last active
September 6, 2018 11:21
-
-
Save tgrabiec/1ffe65ef8fb0bec12a5efb07ec825096 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Usage: make-flame-graph.sh <perf-data-file-path> | |
# | |
# Produces perf-data-file-path.svg with the corresponding flame graph. | |
# | |
set -e | |
fg_dir=~/FlameGraph | |
if [ ! -e $fg_dir ]; then | |
sudo yum install -yq git 1>&2 | |
git clone https://github.com/brendangregg/FlameGraph.git $fg_dir 1>&2 | |
fi | |
export PATH=$PATH:$fg_dir | |
f=$1.svg | |
opts="-i $1" | |
perf script $opts | stackcollapse-perf.pl | flamegraph.pl > $f | |
echo $f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment