How to track child process using strace?

projectshave picture projectshave · Oct 29, 2010 · Viewed 84.3k times · Source

I used strace to attach to a process briefly. The process created 90 threads. When I found the offending thread, I had to tediously search for the parent thread, then the grandparent thread, and so on all the way to the root process.

Is there a trick or tool to quickly figure out which thread created another? Or better yet, print the tree of thread creations like pstree?

Answer

Je Rog picture Je Rog · Jun 11, 2011

strace -f to trace child process that's fork()ed.