This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Enabling static marker support in XULRunner
- From: Rajan Arora <rarora at redhat dot com>
- To: systemtap at sources dot redhat dot com
- Date: Wed, 22 Apr 2009 14:43:04 -0400
- Subject: Enabling static marker support in XULRunner
- Reply-to: rarora at redhat dot com
In continuation to the efforts on enabling packages with static dtrace
probe markers for use with Systemtap:
http://fedoraproject.org/wiki/Features/SystemtapStaticProbes , I
recently experimented with XULRunner. The SDK is used for building
Firefox and enabling the available probe points in xulrunner will allow
for high level tracing of firefox using systemtap. There is a bug report
open for enabling this by default in Fedora Rawhide here:
https://bugzilla.redhat.com/show_bug.cgi?id=496113
Currently, XULRunner java-script source has some static markers that may
be enabled with the reported patch. Attached is an example script that
prints out the file and function names called when firefox runs a page
with java script content in it. Here's some sample output:
http://pastebin.com/f3b016c8c
For the example script to run, xulrunner build on that system should
have static markers enabled, which enables Systemtap to gather such
information.
Cheers
-Rajan
# stap -v -c 'firefox some-javascript-page.html' example-xulrunner.stp 'libmozjs.so location'
# On a Fedora x86_64 box, 'libmozjs.so location' : /usr/lib64/xulrunner-1.9.1/libmozjs.so
global funcinfo
probe begin
{
printf ("Script displays File name, Function name and respective count...\n\n")
}
probe process(@1).mark("function__info")
{
file = user_string ($arg1)
func = user_string ($arg3)
funcinfo[file,func] <<< 1
}
probe end
{
foreach ([i,j] in funcinfo+)
{
printf ("%-75s %-35s %d\n", i, j, @count(funcinfo[i,j]))
}
}