Created
March 14, 2013 22:52
-
-
Save t-mart/5165953 to your computer and use it in GitHub Desktop.
good way to get time data
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
#!/bin/bash | |
#strace | |
# "-e trace=some_syscall" allows you to trace just the syscalls you want. | |
# lotta noise otherwise. comma separated list, but | |
# for our experiments, it'll prolly just be 1 | |
# syscall | |
# "-T" give us time data | |
# | |
# "program arg0 arg1" is the program we want to trace. this'll likely be | |
# something we write that does hundreds of a particular | |
# syscall | |
# | |
# "2>&1" strace outputs to stderr by default. we don't want that because | |
# we're processing later to a pipe. this says to redirect to stdout | |
#grep | |
# "--extended-grep" use more robust regexp language "--regexp" the pattern | |
# | |
# "--only-matching" don't return whole lines, just the match | |
#>> blah.txt outputs to blah.txt. name this to something more specific like | |
# "mkdir_tests.txt" or whatnot. | |
strace -e trace=some_syscall -T program arg0 arg1 2>&1 | grep --extended-regexp -regexp="[[:digit:]]\.[[:digit:]]+" --only-matching >> blah.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment