How to track child process using strace?

后端 未结 4 1343
盖世英雄少女心
盖世英雄少女心 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:24

    To capture traffic for a single process you can use strace, as @stackmate suggested.

    strace -f -e trace=network -s 10000 -p ;
    

    or output it to a file.

    strace -f -e trace=network -s 10000 -o dumpfile -p 
    

    -f for all forked process, -s for string size to print, and -o to dump the output to a file.

提交回复
热议问题