Valgrind with dynamically linked GCC plugin -


i've been using profiling tool valgrind while now. requires executable run, i.e.

$    valgrind ./a.out 

i want use on dynamically linked gcc plugin, , list time taken , number of calls each function used in plugin. running gcc plugin follows:

$    gcc -fplugin=./plugin.so myfile.c 

when run following command, valgrind reports memory leaks gcc , not plugin.so. need way run valgrind exclusively on plugin, .so file.

$    valgrind gcc -fplugin=./plugin.so myfile.c  $    gcc -fplugin=./plugin.so myfile.c -wrapper valgrind 

is possible that? i've searched on lot haven't found concrete answer on it.

i posted question on valgrind-users mailing list , got solution.

http://sourceforge.net/p/valgrind/mailman/message/34174148/

the plugin not loaded gcc child process of gcc. need run valgrind option --trace-childen=yes

 $valgrind –trace-children=yes --leak-check=full g++ -fplugin=./plugin.so test0.o 

we need search valgrind output name of our function , identify child process responsible loading , executing plugin.try introducing memory leaks intentionally in plugin , search function in output, identify process.


Comments