DTrace Shows Solaris Inner Workings

 
 
By Jason Brooks  |  Posted 2004-07-26
 
 
 

The upcoming version of Sun Microsystems Inc.s flagship operating system, Solaris 10, will be the most feature-packed release in some time. One compelling new Solaris component is DTrace, a facility that opens to developers and system administrators a window onto the workings of the operating system and the applications that run on it.

DTrace lets administrators see the same systemwide diagnostic information that current tools such as Suns truss show, but DTrace also allows users to get as fine-grained a level of detail as they require, providing an exploded view of system calls, application function calls and instructions executed by running programs.

Whats more, DTrace does so dynamically; it does not require that examined applications be stopped, nor does it require modifications to the code it examines.

eWEEK Labs spent some time evaluating a test build of Solaris 10 and found that DTrace will let companies running Solaris 10 extend their debugging efforts beyond the territory of application developers to that of system administrators, who will be able to analyze performance problems in real production scenarios. (Test builds of Solaris 10 are available for free download for both SPARC and x86 platforms at www.sun.com/software/solaris/solaris-express/get.html.)

Solaris 10 is expected to begin shipping by years end. We recommend that administrators and developers, particularly those targeting Solaris, take a look at DTrace in the coming months.

Sun has committed to releasing Solaris operating system code as open source. Click here to read more.

How does it work?

Sun describes DTrace as a dynamic tracing utility that provides concise answers to arbitrary questions. Users phrase these questions in a language called D, which Sun put together for DTrace. The D language will be familiar to many users because its based on C and shares most of that languages syntax.

Sun has produced an excellent, lengthy, tutorial-style manual for DTrace, which is available for download at www.sun.com/bigadmin/content/dtrace.

For now, theres no GUI for DTrace, but Sun officials have expressed interest in developing such an interface. However, DTrace is so open-ended in its function that it will be challenging to create an interface thats well-suited to DTraces wide scope.

Users interact with DTrace through command-line directives or with scripts written in D that Sun calls recipes. Quite a few recipes are included in the DTrace manual, and a small repository of DTrace recipes is on a Web page linked from Suns DTrace site.

DTrace commands, or scripts, call on loadable kernel modules called providers. Providers are capable of creating probes, individual points of potential instrumentation within the system. The probes arent active unless theyre called on by a DTrace operation, which helps keep DTraces overhead low.

DTrace is built with safeguards to ensure the facility does not interfere with the smooth operation of systems on which its active. This makes DTrace an appropriate fit for use on live production systems.

Because DTrace doesnt require code changes to the applications it examines, its possible to analyze the operation of any application that runs on Solaris 10. In fact, DTrace could prove useful for applications destined to run on earlier Solaris versions or even on Linux. Provided a developer could compile and run the application on Solaris 10—as is possible with most Linux or Unix applications—optimizations produced with the aid of DTrace could benefit the application once its been brought back to its original platform.

For administrators and developers who are running Linux, IBMs Dynamic Probes, a debugging facility, is available for Linux at www-124.IBM.com/developerworks/oss/linux/projects/dprobes. The Dynamic Probes facility also features dynamic instrumentation, bears some resemblance to DTrace and is worth investigation.

According to Sun officials, some of the major advantages of DTrace over Dynamic Probes include better system stability safeguards, a more robust language and the fact that DTrace will ship as a standard part of Solaris.

Senior Analyst Jason Brooks can be reached at jason_brooks@ziffdavis.com.

Check out eWEEK.coms Developer & Web Services Center at http://developer.eweek.com for the latest news, reviews and analysis in programming environments and developer tools.

Be sure to add our eWEEK.com developer and Web services news feed to your RSS newsreader or My Yahoo page

Rocket Fuel