This should do it. Of course, this only works as long as the parent stays alive during the tracer's execution. Otherwise we'll start writing to log file "<logpath>.1". We can work around this problem with an extra global (parent_pid)... http://llvm-reviews.chandlerc.com/D2306