zhasm
9/19/2016 - 3:29 AM

xdebug2png

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