public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Rajan Arora <rarora@redhat.com>
To: systemtap@sources.redhat.com
Subject: Enabling static marker support in XULRunner
Date: Wed, 22 Apr 2009 18:43:00 -0000	[thread overview]
Message-ID: <49EF6538.3080103@redhat.com> (raw)

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

                 reply	other threads:[~2009-04-22 18:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EF6538.3080103@redhat.com \
    --to=rarora@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).