This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/10697] New: Tapset for generation of XML-esque data


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]