InfoQ Homepage News DTrace: Dynamic Tracing with a Java API

DTrace: Dynamic Tracing with a Java API


DTrace is an open-source dynamic tracing framework originally written for Solaris 10 and coming soon to OS X, Linux and BSD systems. A Java API for DTrace is available, allowing you to run DTrace scripts and allowing you to present the output in a more meaningful way.

In a recent interview with SD Times, the creators of DTrace, Adam Leventhal, Mike Shapiro, and Bryan Cantrill, discuss why DTrace came about and why it was needed. With the advent of the web, existing tracing tools were no longer sufficient, as Cantrill explains:

You had multiple applications now, or multiple processes that form a single application. So an application became not just a binary. But then you had a Web server and an app server and a database server, and now you don't have one language -- you've got three or four or five. You've got these different environments, different protected domains, and the problem is that the problems in software didn't really show up in development.

In response to those challenges, they created DTrace as a tool that would have system-wide scope so you could gather information from all of different sources. An overview of DTrace describes the tool:

DTrace dynamically modifies the operating system kernel and user processes to record data at locations of interest, called probes. A probe is a location or activity to which DTrace can bind a request to perform a set of actions, like recording a stack trace, a timestamp, or the argument to a function. Probes are like programmable sensors scattered all over your Solaris system in interesting places. DTrace probes come from a set of kernel modules called providers, each of which performs a particular kind of instrumentation to create probes.

As of Solaris build 35, DTrace has a Java API. One of the first tools out to utilize this API is Chime. As Bill Rushmore noted, using the Java API will allow for much better visualization of DTrace results.

DTrace is also able to help debugging JavaScript, with the advent of Helper Monkey.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • JXInsight - The Java Enterprise Java Distributed Trace Solution

    by William Louth /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Hi Rob,

    You should really check out JXInsight's Tracer which unlike DTrace is more suited to contextual application/component level tracing across processes and tiers. JXInsight also ships with an awarding application management and performance visualizaton console. I think DTrace is wonderful for those needed to profiling the actual JVM implementation and operating system kernels but I cannot see how this is really going to help resolve most enterprise application problems when there is little context and enormous amount of low level events with little aggregation and event correlation.

    JXInsight's Tracer API:

    Performance Insight Articles showing the many extensions provided based on this API.

    Screen shots of a mature and polished visualization console.

    Kind regards,

    William Louth
    JXInsight Product Architect

    "Java EE tuning, tracing, testing, and monitoring with JXInsight"

  • Re: JXInsight - The Java Enterprise Java Distributed Trace Solution

    by zqu dlyba /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    And for another take at J2EE monitoring, have a look at the open-source MessAdmin. MessAdmin is a notification system and Session administration for J2EE Web Applications, giving detailed statistics and informations on any Web application. It installs as a plug-in to any Java EE WebApp, and requires zero-code modification. A live demo is available at the project's web site.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.