https://bugs.kde.org/show_bug.cgi?id=390310

            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
          Assignee: jsew...@acm.org
          Reporter: renau...@free.fr
  Target Milestone: ---

Created attachment 110555
  --> https://bugs.kde.org/attachment.cgi?id=110555&action=edit
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.
e.g
https://stackoverflow.com/questions/40902804/leak-summary-is-missing-from-valgrind-log-file)
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 : 
<heap_summary>
  <memory_in_use_at_exit bytes="48" in_blocks="3"/>
  <total_heap_usage allocs="4" frees="1" bytes_allocated="1,072"/>
</heap_summary>
<leak_summary>
  <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"/>
</leak_summary>
<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