public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/10697] New: Tapset for generation of XML-esque data
@ 2009-09-26 21:43 chwang at redhat dot com
  2009-09-26 21:45 ` [Bug tapsets/10697] " chwang at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: chwang at redhat dot com @ 2009-09-26 21:43 UTC (permalink / raw)
  To: systemtap

As a possible lead-in to some graphing stuff on Eclipse, I sketched a little
stap set for xml generation. If it would be useful to other users of systemtap,
I would be happy to clean it up a bit and submit :) [If not, it's also all right :)]

All print functions maintain proper tabbing for human readability.

Functions:

opentag(string tag) -- prints <tag>. Tag can be a name ("hello") or a name plus
key-value pairs separated by spaces ("newtag this=that who=what")

addattr(string keyvalue) -- gives the given key-value pair to the currently open
tag.

closecurrent() -- closes the current top-level tag by printing </tag>

closetag(string tag) -- prints </tag>. Not recommended, use closecurrent() instead.

openclosetag(string tag) -- convenience method to create <tag/>

closeall() -- closes all open tags. Recommended to use this in probe end or
probe error so you can get fully formed data in all cases.

setlimit() -- sets the maximum number of tags to keep in memory. Defaults to
100. If this number is exceeded, no new tags are opened. [Currently causes
opentag to return -1, no other error message generated]


Brief example:
stap -e 'probe begin{opentag("BLAH newattr=oldattr") addattr("this=that")
closetag("BLAH") opentag("newtag") opentag("anothertag") addattr("stap=yay")
openclosetag("single attributes=many") closeall() exit() }'

<BLAH newattr=oldattr
	this=that>
</BLAH>
<newtag>
	<anothertag
		stap=yay>
		<single attributes=many/>
	</anothertag>
</newtag>

-- 
           Summary: Tapset for generation of XML-esque data
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: tapsets
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: chwang at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10697

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <bug-10697-6586@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2015-11-28 14:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 21:43 [Bug tapsets/10697] New: Tapset for generation of XML-esque data chwang at redhat dot com
2009-09-26 21:45 ` [Bug tapsets/10697] " chwang at redhat dot com
2009-10-07 14:48 ` fche at redhat dot com
2009-10-07 16:03 ` anithra at linux dot vnet dot ibm dot com
2009-10-07 16:11 ` anithra at linux dot vnet dot ibm dot com
2009-10-22 14:52 ` chwang at redhat dot com
2009-10-22 15:02 ` chwang at redhat dot com
2009-10-22 17:15 ` fche at redhat dot com
     [not found] <bug-10697-6586@http.sourceware.org/bugzilla/>
2015-11-28 14:00 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).