2
votes

I'm doing a little bit of memory profiling to my software and after running standard memory leak check with valgrind's following command

valgrind --tool=memcheck --leak-check=full

I got following summary:

==12550== LEAK SUMMARY:

==12550== definitely lost: 597,170 bytes in 7 blocks

==12550== indirectly lost: 120 bytes in 10 blocks

==12550== possibly lost: 770,281 bytes in 1,455 blocks

==12550== still reachable: 181,189 bytes in 2,319 blocks

==12550== suppressed: 0 bytes in 0 blocks

==12550== Reachable blocks (those to which a pointer was found) are not shown.

==12550== To see them, rerun with: --leak-check=full --show-reachable=yes

==12550==

==12550== For counts of detected and suppressed errors, rerun with: -v

==12550== ERROR SUMMARY: 325 errors from 325 contexts (suppressed: 176 from 11)

But I wanted to get the results in xml format. So I executed the memory leak check with valgrind's following command,

valgrind --tool=memcheck --leak-check=full --xml=yes --xml-file=path_to_output

Here this command executed successfully. But what I noticed is, that xml out put does not contain a LEAK SUMMARY like before.

So I would like to know is there anything that I can do to generate LEAK SUMMARY in xml format.

Thanks

1
what OS / version of valgrind are you using?BobTuckerman

1 Answers

2
votes

There is currently nothing you can do to persuade Valgrind to output LEAK SUMMARY in XML format. The summary is printed only when not outputting to an XML file.

For more details see Valgrind's source code, function print_results():

if (VG_(clo_verbosity) > 0 && !VG_(clo_xml)) {
    ...
    VG_(umsg)("LEAK SUMMARY:\n");
    ...
}