Tracing programs with strace

Trace all child processes and put them into different files prefixed by “outfile”

strace -o outfile -ff ./program

Track all child processes (anything that forks off the parent)

strace -f ./program

Specify multiple pid’s

strace -p <pid1> -p <pid2> -p <pid3> ./program

Tracing Apache processes

ps -ef | grep httpd | awk '{ print "-p " $2}' | xargs strace
This entry was posted in processes. Bookmark the permalink.

Comments are closed.