我怎么告诉的valgrind到MEMCHECK派生进程? [英] How do I tell valgrind to memcheck forked processes?
本文介绍了我怎么告诉的valgrind到MEMCHECK派生进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个过程 X
我要检查与的valgrind
泄漏。问题是, X
是是
和是
又是以Z
运行。我不能运行 X
独立的,因为是
和以Z
设置为环境X
,如环境变量,命令行开关,由 X所需的文件
等
- 有什么办法,我可以告诉
的valgrind
在以Z
运行,但按照其发现的任何叉子和报告他们呢? - 有什么办法,我可以告诉
的valgrind
遵循任何叉子,但只在名为进程报告X
? - 有什么办法,我可以告诉
的valgrind
附加到已经运行的过程中,我可以使用gdb的方式做?
我不知道这事,但我下Suse64 linux和的valgrind-2.4.0。
运行谢谢!
解决方案
- Valgrind的给出的
时,如下派生进程。
- 您应该能够通过使用合适的过滤器来实现这一目标。
- 没有。 Valgrind的挂接到模块加载code。使用LD_ preLOAD,所以连接到正在运行的进程是不可能的。
微量的孩子= YES 选项 -
I have a process x
that I want to check for leaks with valgrind
. The problem is that x
is run by y
, and y
in turn is run by z
. I can't run x
standalone because y
and z
setup the environment for x
, such as environment variables, command line switches, files needed by x
etc.
- Is there any way I can tell
valgrind
to run onz
but to follow any forks it finds and report them too? - Is there any way I can tell
valgrind
to follow any forks but only report on the process namedx
? - Is there any way I can tell
valgrind
to attach to already-running process, the way I can do with gdb?
I don't know if this matters, but I'm running under Suse64 linux and valgrind-2.4.0.
Thanks!
解决方案
- Valgrind follows forked processes when given the
--trace-children=yes
option. - You should be able to achieve this by using suitable filters.
- No. Valgrind hooks into the module loading code using LD_PRELOAD, so attaching to a running process is not possible.
这篇关于我怎么告诉的valgrind到MEMCHECK派生进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文