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
strace -e trace=open -o logfile.log ./mycommand -mycommandparameter
strace -e trace=process -o logfile.log ./mycommand -mycommandparameter
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`
  • Last modified: 2019-12-20 14:21