From aldeid
Jump to navigation Jump to search


Trace system calls and signals.



usage: strace [-CdffhiqrtttTvVxxy] [-I n] [-e expr]...
             [-a column] [-o file] [-s strsize] [-P path]...
             -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]
   or: strace -c[df] [-I n] [-e expr]... [-O overhead] [-S sortby]
             -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]


count time, calls, and errors for each syscall and report summary
like -c but also print regular output
summarise syscall latency (default is system time)
enable debug output to stderr
run tracer process as a detached grandchild, not as parent
follow forks, -ff -- with output into separate files
print instruction pointer at time of syscall
suppress messages about attaching, detaching, etc.
print relative timestamp, -t -- absolute timestamp, -tt -- with usecs
print time spent in each syscall
verbose mode: print unabbreviated argv, stat, termios, etc. args
print non-ascii strings in hex, -xx -- print all strings in hex
print paths associated with file descriptor arguments
print help message, -V -- print version
-a column
alignment COLUMN for printing syscall results (default 40)
-b execve
detach on this syscall
-e expr
a qualifying expression: option=[!]all or option=[!]val1[,val2]...
options: trace, abbrev, verbose, raw, signal, read, write
-I interruptible
1: no signals are blocked
2: fatal signals are blocked while decoding syscall (default)
3: fatal signals are always blocked (default if '-o FILE PROG')
4: fatal signals and SIGTSTP (^Z) are always blocked (useful to make 'strace -o FILE PROG' not stop on ^Z)
-o file
send trace output to FILE instead of stderr
-O overhead
set overhead for tracing syscalls to OVERHEAD usecs
-p pid
trace process with process id PID, may be repeated
-s strsize
limit length of print strings to STRSIZE chars (default 32)
-S sortby
sort syscall counts by: time, calls, name, nothing (default time)
-u username
run command as username handling setuid and/or setgid
-E var=val
put var=val in the environment for command
-E var
remove var from the environment for command
-P path
trace accesses to path


Keywords: strace