Skip to content

Instantly share code, notes, and snippets.

@rchrd2
Created November 19, 2013 21:57
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 rchrd2/7553280 to your computer and use it in GitHub Desktop.
Save rchrd2/7553280 to your computer and use it in GitHub Desktop.
Watch a directory then automatically render and open profile graphs.
#!/bin/sh
watchmedo shell-command \
--pattern="*prof" \
--ignore-pattern="*png" \
--wait \
--command='find profile_data -name "*\.prof" -exec sh -c "test -f {}.png || (gprof2dot -f pstats {} | dot -Tpng -o {}.png && open {}.png)" \;' \
profile_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment