From: John R. <jr...@bi...> - 2018-02-28 04:13:05
|
> LD_PRELOAD=./libfake.so ./my_process --> runs fine and prints memory stats > > But, > > LD_PRELOAD=./libfake.so valgrind ./my_process --> doesnt print the memory stats > > From few online blogs, i understand that valgrind does forward any signals to the child process that it is running on but it doesnt seem to work here. There is no parent-child relationship between valgrind and ./my_process. Both valgrind and ./my_process run in the same address space as just one process. The inter-process communication would be extremely expensive if valgrind and ./my_process did not share the same address space, and memcheck tracking of each memory access would be difficult if there were 2 threads of control. The command-line parameter "--trace-signals=yes" causes valgrind to report on signals. The Linux utility /usr/bin/strace also reports on signals. (Probably use something like "strace -e trace=file" to reduce the syscalls that strace reports; in particular 'read' and 'write' are usually heavily used and ignorable.) |