Testing a snippet of code with valgrind

How can I test a specific part of my program using valgrind (and perf if the same principles apply)? I am asking this because perf./progname checks the whole program.

I cannot remove the other parts because the part I need to check depends on them.

thank

+3


source to share


1 answer


You cannot run part of a program under Valgrind; Valgrind is all or nothing.

What you can do is tell him to ignore errors that you are not interested in (because they are part of a program that you cannot fix, for example). To do this, check out the Valgrind Suppression Howto: http://wiki.wxwidgets.org/Valgrind_Suppression_File_Howto



It won't speed up anything, although if the speed of your motivation, it won't help.

+1


source







All Articles