RajSanpui
RajSanpui

Reputation: 12054

How to associate valgrind with a running process?

I have a binary called "ifmFuseHandler" which is invoked by a shell-script something like this: su - $USER -c "cd $DIR_INDEX;valgrind --leak-check=full ifmFuseHandler $IFM_SINGLE_THREAD -o allow_other $IFM_MOUNT"

But the problem is, i can see the valgrind logs only once, when the control hits this line of shell, and post that even though the ifmFuseHandler is up and running, valgrind does not provide any profiling info.

So, as you can see below, but no further logging:

insite1@POC-Messaging1:/opt/insiteone/log> ps -ef | grep ifmFuseHandler
insite1    622     1  0 04:19 ?        00:00:02 valgrind --leak-check=full ifmFuseHandler -o allow_other /opt/insiteone/fuse-mount
insite1   3225 26014  0 04:32 pts/2    00:00:00 grep ifmFuseHandler

Upvotes: 1

Views: 7704

Answers (1)

user571138
user571138

Reputation:

You need to adjust your shell-script to explicitly log the output of valgrind to a file as described here.

If your program is invoked multiple times, try using a filename with the PID, as described in the usage of --log-file=<filename> here.

Just make sure your output file is in an easily readable location.

Upvotes: 1

Related Questions