This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: XML(-ish) output?
- From: "Oestman, Fredrik" <Fredrik_Oestman at mentor dot com>
- To: Albretch Mueller <lbrtchx at gmail dot com>
- Cc: "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Tue, 2 Oct 2012 08:24:01 +0000
- Subject: RE: XML(-ish) output?
- References: <CAFakBwjcZ=R--b3T4WNoh62Rv4zTco7-7t-c1eY+DFutv4XLGg@mail.gmail.com> <y0m1uhicljt.fsf@fche.csb>
Frank Ch. Eigler wrote:
> Albretch Mueller <lbrtchx@gmail.com> writes:
> > I couldn't find any reference to generating output files as XML
> > documents in sourceware's documentation per se [...]
> One can do so from first principles:
>
> probe FOO {
> printf("<tag attrib=\"foo\">\n");
> printf("<bar/>\n");
> printf("</tag>\n");
> }
>
> How much deeper support for xml generation were you hoping for?
> Quoting of some sort?
I've once experimented with utility functions providing brackets and the end tag, but I ran into problems with the maximum string length when nesting. So most of the output was from first principles as above.
function tags( name, content )
{
return sprint( "<%s>%s</%s>/n", name, content, name );
}
Cheers,
Fredrik Östman
http://go.mentor.com/sourceryanalyzer/