Monday, September 21, 2009

strace

In the simplest case strace runs the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a rocess. The name of each system call, its arguments and its return value are printed on standard error or to the file specified with the -o option.

% strace -f -F -o ~/output_strace.txt $command

-f : Trace child processes as they are created by currently traced processes as a result of the fork(2) system call.
-F : Attempt to follow vforks.
-o : Write the trace output to the file filename rather than to stderr.

No comments: