public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Enabling static marker support in XULRunner
@ 2009-04-22 18:43 Rajan Arora
  0 siblings, 0 replies; only message in thread
From: Rajan Arora @ 2009-04-22 18:43 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]


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


[-- Attachment #2: example-xulrunner.stp --]
[-- Type: text/plain, Size: 549 bytes --]

# 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]))
  }
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-22 18:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 18:43 Enabling static marker support in XULRunner Rajan Arora

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).