Skip to content

Instantly share code, notes, and snippets.

@yangacer
Created August 5, 2011 16:39
Show Gist options
  • Save yangacer/1127939 to your computer and use it in GitHub Desktop.
Save yangacer/1127939 to your computer and use it in GitHub Desktop.
generate program profile with callgraph
#!/bin/sh
# Dependencies:
# 1. gprof
# 2. gprof2dot
# 3. c++filt
# 4. dot (/usr/ports/x11-fonts/urwfonts)
help="profcg.sh executable output"
if [ $# -ne 2 ]; then
echo "$help"
exit 1
fi
exe=$1
out=$2
`gprof $exe | gprof2dot.py -n 3.0 | c++filt | dot -Tpng -o ${out}.png`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment