Created
August 5, 2011 16:39
-
-
Save yangacer/1127939 to your computer and use it in GitHub Desktop.
generate program profile with callgraph
This file contains hidden or 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
#!/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