X

DTrace/Firefox/Leopard

Guest Author

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.

Join the discussion

Comments ( 5 )
  • Derek Morr Saturday, October 27, 2007

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


  • Brendan Gregg Sunday, October 28, 2007

    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 .


  • Brian Crowder Monday, October 29, 2007

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


  • Adam Leventhal Monday, October 29, 2007

    Brian,

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


  • Myk Melez Tuesday, October 30, 2007

    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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services