strace

Important Options

-f            # follow forks 
-o $filename  # write trace output to file
-p $pid       # attach to process ID
-s $strsize   # maximum string size to print (defaults to 32 chars) i.e %file
-e $expr      # which events to trace
-Z print      # only syscalls that returned an error code
-r            # show timestamps for syscalls