Created
December 5, 2010 21:37
-
-
Save dpo/729495 to your computer and use it in GitHub Desktop.
Create a pdf with profile information in the form of a directed graph. Requires graphviz and gprof2dot.py
This file contains 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/bash | |
outfile="profile-$$" | |
python -m cProfile -o ${outfile}.pstats $@ | |
if [[ $? ]]; then | |
gprof2dot.py -f pstats ${outfile}.pstats | dot -Tpdf -o ${outfile}.png | |
echo "Profile graph is in ${outfile}.png" | |
else | |
echo "Profile creation aborted." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment