Java DTrace API

Java DTrace API

Java DTrace API

The Java DTrace API is now available on Solaris Nevada (build 35 or later). This is the first public programming interface for DTrace. (The native DTrace library implemented in C is currently private.) Bindings for other programming/scripting languages should eventually arrive on the scene as well.

The Chime project page on OpenSolaris has more information about the API, including source and examples. One example to highlight here: I thought that a Java implementation of dtrace(1M) would be a great way to demonstrate how to use the new API to access functionality associated with familiar dtrace command options. Get jdtrace and give it a try. The majority of options are supported and in most cases the output of jdtrace and dtrace(1M) should be identical. I also emulated the behavior of Ctrl-C (printing unprinted aggregations before exiting) using Runtime.getRuntime().addShutdownHook() (this Java Developer Forums thread has other suggestions for handling Ctrl-C in Java).

Primarily I use jdtrace to leverage the existing DTrace test suite (and its thousand-or-so D programs) for testing of the Java DTrace API. I hope it also serves as a source of programming examples.

I should also mention the Chime Visualization Tool for DTrace, a new project on OpenSolaris that uses the Java DTrace API to display multiple running aggregations simultaneously. Please visit the project page and share your feedback on the dtrace-discuss list.

Comments:

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

tomee

Search

Categories
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
Blogs
Other

No bookmarks in folder