InfoQ

News

DTrace: Dynamic Tracing with a Java API

Posted by Rob Thornton on Nov 16, 2006 05:06 PM

Community
Java
Topics
Debugging
Tags
DTrace

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.

2 comments

Reply

JXInsight - The Java Enterprise Java Distributed Trace Solution by William Louth Posted Nov 19, 2006 11:09 AM
Re: JXInsight - The Java Enterprise Java Distributed Trace Solution by zqu dlyba Posted Nov 20, 2006 3:13 AM
  1. 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: http://www.jinspired.com/products/jxinsight/api/com/jinspired/jxinsight/trace/Tracer.html Performance Insight Articles showing the many extensions provided based on this API. http://www.jinspired.com/products/jxinsight/insights.html http://blog.jinspired.com/ Screen shots of a mature and polished visualization console. http://www.jinspired.com/products/jxinsight/new-in-4.2.html http://www.jinspired.com/products/jxinsight/new-in-4.1.html http://www.jinspired.com/products/jxinsight/new-in-4.0.html Kind regards, William Louth JXInsight Product Architect JInspired "Java EE tuning, tracing, testing, and monitoring with JXInsight" http://www.jinspired.com

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

Exclusive Content

Using Ruby Fibers for Async I/O: NeverBlock and Revactor

Ruby 1.9's Fibers and non-blocking I/O are getting more attention - we talked to Mohammad A. Ali of the NeverBlock project and Tony Arcieri of the Revactor project.

Agile and Beyond - The Power of Aspirational Teams

Tim Mackinnon talks about the aspirations behind the Agile principles and practices, the desire to become efficient, to write quality code which does not end up being thrown away.

Concurrency: Past and Present

Brian Goetz discusses the difficulties of creating multithreaded programs correctly, incorrect synchronization, race conditions, deadlock, STM, concurrency, alternatives to threads, Erlang, Scala.

ActionScript 3 for Java Programmers

Often the hardest part of changing technologies is language syntax differences. This new article provides Java developers with a transition guide to Actionscript which forms the foundation of Flex.

Neal Ford On Programming Languages and Platforms

Neal Ford talks about having multiple languages running on one of the two major platforms: Java and .NET. He also presents the advantages offered by Ruby compared to static languages like Java or C#.

Future Directions for Agile

David Anderson talks about the history of Agile, the current status of it and his vision for the future. The role of Agile consists in finding ways to implement its principles.

Nick Sieger on JRuby

Nick Sieger talks about the future of JRuby, Java Integration, and his work on JEE deployment tools for Ruby on Rails like Warbler.

Rustan Leino and Mike Barnett on Spec#

Rustan Leino and Mike Barnett of Microsoft Research discuss the technology in Spec# and its futures.