如何使用strace跟踪子进程? [英] How to track child process using strace?
本文介绍了如何使用strace跟踪子进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用strace
简要地附加到进程.该过程创建了90个线程.当我找到有问题的线程时,我不得不繁琐地搜索父线程,然后是祖父母线程,等等,一直到根进程.
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.
是否有技巧或工具可以快速找出哪个线程创建了另一个线程?还是更好,打印诸如pstree
之类的线程创建树?
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
?
推荐答案
strace -f
跟踪fork()
ed的子进程.
strace -f
to trace child process that's fork()
ed.
这篇关于如何使用strace跟踪子进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文