Table of Contents

strace (Stack Trace)

Important parameters:

-o filename output to file filename
-f check forks
-tt protocol time (microseconds)
-p pid only protocol system calls with PID pid
-e limit output, see below

Which files get accessed by the program?

strace -e trace=open -o logfile.log ./mycommand -mycommandparameter

Which processes get started/paused/terminated by the program?

strace -e trace=process -o logfile.log ./mycommand -mycommandparameter

protocol syscalls of already started programs

ps aux | grep mycommand | grep -v grep mycommand
strace -o logfile.log -p 123
 
# if there's only one program running with that name:
strace -o logfile.log -p `pidof mycommand`