Monday Jul 04, 2011

Making yourself indispensible with DTrace

DTrace technology and tools appeared in 2005, and despite this, it is still not very well known among majority of developers and system administrators. It is especially surprising given that for five and a half years since the release of Solaris 10, where DTrace was first implemented, there was no better technology made for analyzing of operating systems and applications.[Read More]

Tuesday May 31, 2011

A D Script for Observing the Network - Take Two

About a year and a half ago I wrote about a nifty little D script I came across while working with the now defunct Crossbow Virtual Wire Demo Tool. However, the script stopped compiling somewhere between the release of OpenSolaris 2009.06 and Solaris 11 Express. 

Solaris 11 Express also included the addition of two new DTrace providers, TCP and UDP. These new providers make it possible to simplify the script and Solaris Systems Architect Andrew Gabriel did this.[Read More]

Tuesday Nov 10, 2009

A D Script for Observing the Network

A little gem included with the Crossbow Virtual Wire Demo Tool is a DTrace script and associated Chime display written by Crossbow engineer Kais Belgaied. I've augmented the script a bit by adding an END clause to format the output, which shows the number of bits transferred over the period of time the script is run:[Read More]

Wednesday Oct 28, 2009

D Script Archeology

I've read that the best way to learn DTrace is to study existing D scripts. However, upon doing so I quickly find myself asking "where is that documented?" And it turns out, with tens of thousands of probes, as is often the case, it's not. So I'd love to hear what others with more DTrace experience do, but these are the steps I seem to have stumbled upon.[Read More]

Friday Oct 23, 2009

DTrace Quick Start Guide

Sun ISV engineer and DTrace evangelist Angelo Rajadurai has just authored a new quick start guide to DTrace. The guide is based on his "Observing Applications with DTrace" presentation (slides, video) at CommunityOne West and focuses on tracing web applications. The examples from the book have also been added to a wiki page for easier copy & paste.

(click the image to open PDF)

Wednesday Oct 21, 2009

DTrace Toolkit

A hidden little gem that comes included with your installation of OpenSolaris is the DTrace Toolkit. You'll find it installed at /opt/DTT.

The DTrace Toolkit is a collection of tools written by volunteers of the DTrace community, led by Brendan Gregg. What I find most impressive is how well it has been put together. There are 230 executable DTrace scripts, each with their own man page. The scripts are organized by type (CPU analysis, I/O analysis, etc.) so they are easy to study, but they've all been symlinked into a Bin directory, so they are easy to put on your path. I've added the following to my ~/.bashrc file:

# DTrace Toolkit

In addition to their man pages, all of the scrips have a -h help option, for example:

bleonard@os200906:~$ execsnoop -h
USAGE: execsnoop [-a|-A|-ehjsvZ] [-c command]
       execsnoop                # default output
                -a              # print all data
                -A              # dump all data, space delimited
                -e              # safe output, parseable
                -j              # print project ID
                -s              # print start time, us
                -v              # print start time, string
                -Z              # print zonename
                -c command      # command name to snoop
        execsnoop -v            # human readable timestamps
        execsnoop -Z		# print zonename
        execsnoop -c ls         # snoop ls commands only

Note, if you want to run the DTrace scripts from your user account, run the following command to add the needed privileges, substituting in your user name:

pfexec usermod -K defaultpriv=basic,dtrace_user,dtrace_proc,dtrace_kernel <user>

To get started learning all that's available, I recommend reading the DTrace Tookkit page. Also, Stefan Parvu has an excellent presentation on DTrace and the toolkit that's worth a look.

With this toolkit there's probably little need to write a DTrace script from scratch - it's literally a treasure chest of material that I've only begun to explore.

Wednesday Jul 29, 2009

Remote Systems Tracing with Chime

Chime has a nifty little feature where you can run it in server mode and then monitor the system remotely using the Chime GUI.[Read More]

Friday Jul 24, 2009


Chime is a graphical user interface for DTrace that makes viewing DTrace output enjoyable.[Read More]

Saturday Apr 11, 2009

Another OpenSolaris presentation from Community One

Nick Solter and Dave Miner (authors of OpenSolaris Bible) presented a session called Becoming an OpenSolaris Power User, which covers topics such as ZFS, DTrace and networking at Community One. Source: Nick Solter's blog.

Tuesday Mar 03, 2009

OpenSolaris 2008.11 Training in Brno

Me, Martin Man and Lubos Kocman (all three CZOSUG leaders) organized a full day training at Faculty of Informatics Masaryk university, Brno. Sun is partnering this university and we cooperate a lot around OpenSolaris. I've been to the university about 6 times so far. The most recent training was focused on 2008.11 and it was also an install fest. Here are the slides from the event:[Read More]

Thursday Feb 05, 2009

Don't shout at your disks!

A friend of mine from CZOSUG sent me a link to this amazing video - realtime analysis of vibrations caused by sound with DTrace and FishWorks on the Sun 7000 storage (based on OpenSolaris). Lesson learned: shouting can be dangerous to your data!

Friday Aug 29, 2008

What makes OpenSolaris interesting? Reason #3: DTrace

DTrace is very cool. I was skeptical first - because I hate learning a new language for a task, but learning D language is worth it, you can get so much information from the system...

[Read More]

Tuesday Aug 26, 2008

DTrace Privileges

I wanted to learn more about DTrace, so I started at the beginning: Chapter 1 of the Solaris Dynamic Tracing Guide. Using my installation of OpenSolaris 2008.05, I typed in the first command described, but it did not work. This is because in order to use DTrace, my account needs additional privileges that were not specified when the account was created.

To add the necessary privileges to my account, I followed these instructions on the frequently helpful Solaris Internals performance wiki.

[Read More]

Tuesday Aug 05, 2008

New NetBeans plug-in for DTrace

A new version (0.4) of NetBeans DTrace GUI plug-in is ready for download from NetBeans Update Center.

New features include:

- Chime (the DTrace output visualization) is embedded into the NetBeans DTrace GUI Plugin. Chime is fully integrated with NB DTrace GUI.
- The new version of DTraceToolkit is integrated with the new release of NB DTrace GUI. Users can debug and tune their Java, JavaScripts, PyThon, Ruby, Php, C, C++, and etc. applications using the new version of DTrace GUI on Solaris platfrom.
- New & enhanced UI.
- An Open-Sourced project at Developers can participate in future implementations such as DTrace Editor which includes Dtrace code completion, syntax checking and code folding.
- Works with Sun Studio IDE Express releases.
- Works with NetBeans IDE 6.0, 6.1, and 6.5.

For more information, see:


The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


« April 2014