How to track child process using strace?

后端 未结 4 1345
盖世英雄少女心
盖世英雄少女心 2020-12-12 17:57

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

4条回答
  •  春和景丽
    2020-12-12 18:27

    I can't see an easy way:

    You could use the -ff option with -o filename to produce multiple files (one per pid).

    eg:

    strace -o process_dump -ff ./executable
    grep clone process_dump*
    

    that would help you see which parent created what. Maybe that would help you - at least then you could search backwards.

提交回复
热议问题