Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created June 3, 2013 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/5700002 to your computer and use it in GitHub Desktop.
Save bahamas10/5700002 to your computer and use it in GitHub Desktop.
generate flamegraph
#!/usr/bin/env bash
#
# Simply create a flame graph and open it
#
# gen-flame.sh <trace file> [ filter ]
if [[ ! -f "$1" ]]; then
echo "Usage: ${0##*/} <trace file>" >&2
exit 1
fi
filename=${1%.*}.svg
c++filt -n < "$1" > "$1.demangled"
./stackcollapse.pl "$1.demangled" | ./flamegraph.pl > "$filename"
open "$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment