Bug ID: 390310
           Summary: Output summaries in XML files
           Product: valgrind
           Version: unspecified
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
  Target Milestone: ---

Created attachment 110555
Patch file

The XML output of valgrind does not contain the different summaries from the
text format (namely the heap, leak and error summaries). In consequence, the
creation of a digest of the results (for example for an external GUI) is more
difficult. This question has apparently already been asked without answers (cf.
and the persons I asked actually parse the text output to create their digests.
I haven't found a similar question in the bugtracker. 

I propose a patch (to apply to the master git branch) that adds these summaries
into the XML output. As a result of the patch, it is possible to output to XML
and simply test (for example) whether all heap blocks have been freed : 

valgrind --xml=yes --xml-file=res.xml some_executable_to_test

xmllint --xpath "string(/valgrindoutput/all_heap_blocks_freed/@val)" res.xml 

# -> outputs "true" of "false"

This patch impacts a minor part of valgrind (namely just the output). I tried
to follow the coding standards from the source. I am willing to discuss the
form of the output if necessary. For example, at the moment, I store the
results inside attributes instead of the nodes themselves, and this can be
changed. I tried to run the regression and performance tests, but they fail on
my machine with or without the patch. 

Example of output in XML format : 
  <memory_in_use_at_exit bytes="48" in_blocks="3"/>
  <total_heap_usage allocs="4" frees="1" bytes_allocated="1,072"/>
  <definitely_lost bytes="48" in_blocks="3"/>
  <indirectly_lost bytes="0" in_blocks="0"/>
  <possibly_lost bytes="0" in_blocks="0"/>
  <still_reachable bytes="0" in_blocks="0"/>
  <suppressed bytes="0" in_blocks="0"/>
<error_summary errors="3" from="3" suppressed="0" suppressed_from="0"/>

You are receiving this mail because:
You are watching all bug changes.

Reply via email to