Created
December 3, 2010 22:44
-
-
Save erickt/727666 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| global tids | |
| global bytecount | |
| global exes | |
| probe syscall.read { | |
| exes[tid()] = execname(); | |
| tids[tid()] = fd; | |
| } | |
| probe syscall.read.return { | |
| t = tid() | |
| if (t in tids) { | |
| fd = tids[t]; | |
| if (!([t, fd] in bytecount)) | |
| bytecount[t, fd] = 0; | |
| bytecount[t, fd] += strtol(retstr, 10); | |
| delete tids[t]; | |
| } | |
| } | |
| probe timer.ms(%d) { | |
| foreach ([t, fd] in bytecount) | |
| printf("%%d %%d %%s %%d\\n", t, fd, exes[t], bytecount[t, fd]); | |
| exit(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment