DTrace/Firefox/Leopard

It's been more than a year since I first saw DTrace on Mac OS X, and now it's at last generally available to the public. Not only did Apple port DTrace, but they've also included a bunch of USDT providers. Perl, Python, Ruby -- they all ship in Leopard with built-in DTrace probes that allow developers to observe function calls, object allocation, and other points of interest from the perspective of that dynamic language. Apple did make some odd choices (e.g. no Java provider, spurious modifications to the publicly available providers, a different build process), but on the whole it's very impressive.

Perhaps it was too much to hope for, but with Apple's obvious affection for DTrace I thought they might include USDT probes for Safari. Specifically, probes in the JavaScript interpreter would empower developers in the same way they enabled Ruby, Perl, and Python developers. Fortunately, the folks at the Mozilla Foundation have already done the heavy lifting for Firefox -- it was just a matter of compiling Firefox on Mac OS X 10.5 with DTrace enabled:

There were some minor modifications I had to make to the Firefox build process to get everything working, but it wasn't too tricky. I'll try to get a patch submitted this week, and then Firefox will have the same probes on Mac OS X that it does -- thanks to Brendan's early efforts -- on Solaris. JavaScript developers take note: this is good news.

Comments:

The hotspot provider is supported in Apple's Java 6 package. Unfortunatly, Java 6 isn't shipping with Leopard. It will be available sometime in the near future (there's a preview in ADC now).

Posted by Derek Morr on October 27, 2007 at 06:24 AM PDT #

Awsome! The JavaScript DTrace probes and the default capabilities of DTrace are providing powerful new ways to observe the behaviour of JavaScript and the browser like never before. It's great news that MacOS X users will be able to enjoy what is the future of performance observability.

More details about the JavaScript probes can be found on the OpenSolaris page and the Bugzilla entry: http://www.opensolaris.org/os/project/mozilla-dtrace and https://bugzilla.mozilla.org/show_bug.cgi?id=388564 .

Posted by Brendan Gregg on October 28, 2007 at 08:01 AM PDT #

Adam: Have you opened a bugzilla bug to track the build changes you made, yet?

Posted by Brian Crowder on October 29, 2007 at 03:37 AM PDT #

Brian,
Not yet. I'm hoping Brendan can help me navigate the process...

Posted by Adam Leventhal on October 29, 2007 at 09:42 AM PDT #

Adam, I've filed a bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=401806

Sign up for a Bugzilla account here:

https://bugzilla.mozilla.org/createaccount.cgi

Then assign the bug to yourself, attach the patch, and request review from the appropriate owner/peer of the code you are changing (for build changes, this is probably Benjamin Smedberg).

Note that Ryan Flint has also created a patch, which is available here:

http://screwedbydesign.com/mozilla/dtracemac.diff

Posted by Myk Melez on October 30, 2007 at 10:40 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

Adam Leventhal, Fishworks engineer

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today