-
-
Save jamesbrink/4537b99587927f43e586dfe1b33b5a78 to your computer and use it in GitHub Desktop.
Run Dtrace with gource.
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
Here is a quick visualization of file activity using Gource :) | |
This was run on OSx, linux users can use strace to watch for open files, much better performance. | |
# Using lsof in a loop (no sudo required) | |
(while :; do lsof |gsed -r "s#(\w+)\s+.*\s+(.+)#$(gdate +"%s")\|\1\|M\|\2#;t;d";done) | \ | |
gource --realtime --filename-time 2 --highlight-users --1280x800 --log-format custom - | |
# Using Dtrace (better option, could replace with opensnoop possibly but still requires dtrace) | |
sudo dtrace -n 'syscall::open*:entry { printf("%u|%s|%s",walltimestamp,execname,copyinstr(arg0)); }' | \ | |
gsed -r 's#.+ ([0-9]{10}).+\|(.+)\|(.+).+#\1\|\2\|M\|\3#;t;d' |\ | |
gource --realtime --filename-time 2 --highlight-users --1280x800 --log-format custom - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment