Bug 282949 - Enable xml output on the drd tool
Summary: Enable xml output on the drd tool
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: drd (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: Bart Van Assche
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 02:11 UTC by Wainer S. Moschetta
Modified: 2012-03-08 15:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Enable XML output for DRD. (117.94 KB, patch)
2011-10-05 18:32 UTC, Bart Van Assche
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wainer S. Moschetta 2011-09-28 02:11:21 UTC
Version:           unspecified
OS:                Linux

Enable XML output on drd tool is going to allow easy integration with GUI tools. One example of tool which might take advantage of an XML output is the Linux Tools Valgrind plug-in for Eclipse IDE (http://www.eclipse.org/linuxtools/projectPages/valgrind) 

Some Valgrind tools (e.g Helgrind, memcheck) already support XML output via any of --xml, --xml-fd, --xml-file or --xml-socket flags. So the idea is to use the already existing Valgrind's infrastructure for XML-formatted reports on the drd tool.


Reproducible: Didn't try



Expected Results:  
$ valgrind --tool=drd --exclusive-threshold=<threshold> --xml-file=output.xml <application>
$ valgrind --tool=drd --exclusive-threshold=<threshold> --xml <application>
Comment 1 Bart Van Assche 2011-10-05 18:31:37 UTC
Does the attached patch (which is relative to trunk r12106) allow to construct a tool that uses the DRD XML output in a useful way ?
Comment 2 Bart Van Assche 2011-10-05 18:32:27 UTC
Created attachment 64252 [details]
Enable XML output for DRD.
Comment 3 Wainer S. Moschetta 2011-10-08 04:30:39 UTC
Hi Bart,

Yes, it does. I've applied attached patch and tested it against some drd testcases. The options --xml-file and --xml-fd seems to work fine. However, I didn't test the --xml-socket option.

Do you plan to document the XML format somewhere?

Thank your for promptly code this feature.
Comment 4 Bart Van Assche 2011-10-11 19:14:32 UTC
XML output support has been added as r12137.
To do: document the output format.
Comment 5 Julian Seward 2011-10-13 09:46:54 UTC
Bart, also add a brief comment in the NEWS file mentioning
this, if you didn't already.
Comment 6 Bart Van Assche 2011-10-13 18:25:36 UTC
(In reply to comment #3)
> Do you plan to document the XML format somewhere?

A document called drd/docs/drd-xml-output.xsd has been added via r12147. Is that sufficient as documentation ?
Comment 7 Bart Van Assche 2011-10-13 18:57:47 UTC
(In reply to comment #5)
> Bart, also add a brief comment in the NEWS file mentioning
> this, if you didn't already.

See also r12150.
Comment 8 Wainer S. Moschetta 2011-10-25 19:49:13 UTC
(In reply to comment #6)
> (In reply to comment #3)
> > Do you plan to document the XML format somewhere?
> 
> A document called drd/docs/drd-xml-output.xsd has been added via r12147. Is
> that sufficient as documentation ?

Yes, I've review and it seems find.

Thanks!
Comment 9 Wainer S. Moschetta 2011-10-25 20:39:25 UTC
Hi Bart,

I've found a problem with xml options when I've checked out latest Valgrind sources today:

$ ../vg-in-place --tool=drd --xml=yes tests/annotate_hb_race
valgrind: Bad option: --xml=yes, but no XML destination specified
valgrind: --xml=yes has been specified, but there is no XML output
valgrind: destination.  You must specify an XML output destination
valgrind: using --xml-fd, --xml-file or --xml-socket.
valgrind: Use --help for more information or consult the user manual.

OK, It says says I need to also place --xml-fd, --xml-file or --xml-socket. Now:
 
$ ../vg-in-place --tool=drd --xml=yes --xml-fd=/dev/fd/1   tests/annotate_hb_race
valgrind: Bad option: --xml-fd=/dev/fd/1
valgrind: Use --help for more information or consult the user manual.

It says there isn't --xml-fd option. I tried with --xml-file and it works fine.
Comment 10 Bart Van Assche 2011-10-26 16:17:21 UTC
The argument for --xml-fd is a number, not a path. This works here:

$ ../vg-in-place --tool=drd --xml=yes --xml-fd=1 tests/annotate_hb_race
<?xml version="1.0"?>

<valgrindoutput>
[ ... ]
Comment 11 Wainer S. Moschetta 2011-10-26 17:08:23 UTC
(In reply to comment #10)
> The argument for --xml-fd is a number, not a path. This works here:
> 
> $ ../vg-in-place --tool=drd --xml=yes --xml-fd=1 tests/annotate_hb_race
> <?xml version="1.0"?>
> 
> <valgrindoutput>
> [ ... ]

Hey Bart,

My bad, you are right. I can see it now.