Skip to content

Instantly share code, notes, and snippets.

@zhasm
Last active September 19, 2016 03:31
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 zhasm/164ffe73a3d8891af033a5d6d6dba9a1 to your computer and use it in GitHub Desktop.
Save zhasm/164ffe73a3d8891af033a5d6d6dba9a1 to your computer and use it in GitHub Desktop.
xdebug2png
#!/usr/bin/env bash
# brew/apt-get/yum install graphviz
# sudo pip install gprof2dot
# cmd:
# gprof2dot -n 10 -f callgrind INPUT_FILE |dot -Tpng -o OUTPUT.png
if [[ $# -lt 2 ]]; then
echo "Usage: $0 <INPUT-FILENAME: xdebug.out.xxx> <OUT-FILENAME: xxx.png> [other gp\
rof2dot options like -n 10]"
exit 0
fi
input=$1
shift
output=$1
shift
gprof2dot -f callgrind $input $*|dot -Tpng -o $output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment