Strace
Notes
straceis a Linux-only program that lists all the system call that a program is doingBase usage:
strace <program-to-trace>(e.g.,strace ls)Each line of
strace's output will containthe process ID
the name of the system call
the system call arguments
the return value
Useful flags:
strace -e <system call> <program>will only display the calls to the system call passed as argument (e.g.,strace -e openwill only list the calls to theopensystem call)strace -f <program>will follow the subprocesses started by the original program (-fstands for follow)strace -o <output-file>will redirect the output to the specified<output-file>strace -p <pid>will list the system calls for a live processstrace -s <num-chars>will show the first<num-chars>characters of each stringstrace -zwill only show system calls that returned without an error codestrace -Zwill only show system calls that returned with an error code
Resources
Websites
Last updated