31 May, 2006

DTraceTazTool - alpha release

Several years ago, Richard McDougall wrote taztool - a GUI to display disk activity in an amazing and intuitive way. It used TNF trace data - a predecessor of DTrace.

In Janurary 2006 I began writing a DTrace version of taztool: DTraceTazTool. I wrote it using GTK and DTrace. Since then, the DTrace JNI has been released, and I've paused developing DTraceTazTool until I've taken a long look at Java 1.5. Until then, I'm releasing where I am at with the GTK/C version, on my DTrace website.

This is an alpha release - I'm still adding functionality, working through a todo list and fixing bugs. I'm releasing it early as it is already somewhat useful, and a great demo of DTrace. Probably the next feature I'll add is the ability to trace an entire disk at a time (rather than per-slice).

The following screenshot shows a UFS file system that was archived using the tar command. For the top plot: the requested block location is on the Y-axis, time is the X-axis, and the colour reflects the number of requests for that location (many == red). The bottom plot shows maximum and average seek distance.



DTraceTazTool already has some tunable options, such as the size of the pixels drawn and the sample rate,



DTraceTazTool needs to either run as root, or as a user with the dtrace_kernel privilege.

I hope you enjoy the tool so far. I'll post about updates as I complete them.

28 May, 2006

Book Updates

Jim did post an entry about Solaris Internals 2nd edition and Sun Performance and Tuning. We are all now eagerly awaiting the publication of these books.

An article about these books was posted on sunflash.sun.com (login required), a website of Sun events.

And some updates were made to the Prentice Hall website for these books (Solaris Internals 2nd edition, Sun Performance and Tools).
DTracing Scheduling Classes

I've recently been working on some new killer DTrace scripts, and the DTrace UK Workshops. I thought I'd take a break and share something interesting.

The following is from the DTraceToolkit, and is one of my favourite tool example files (Docs/Examples/priclass_example.txt). I'm a firm believer in providing examples, and plan to enhance the existing examples in the toolkit further. There also seems to be a trend to include more examples in Solaris man pages (such as zfs and zpool), which is great to see.



The following is a demonstration of the priclass.d script.

The script was run for several seconds then Ctrl-C was hit. During this time, other processes in different scheduling classes were running.
# ./priclass.d
Sampling... Hit Ctrl-C to end.
^C

IA
value ------------- Distribution ------------- count
40 | 0
50 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 30
60 | 0

SYS
value ------------- Distribution ------------- count
< 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4959
0 | 0
10 | 0
20 | 0
30 | 0
40 | 0
50 | 0
60 | 30
70 | 0
80 | 0
90 | 0
100 | 0
110 | 0
120 | 0
130 | 0
140 | 0
150 | 0
160 | 50
>= 170 | 0

RT
value ------------- Distribution ------------- count
90 | 0
100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 110
110 | 0

TS
value ------------- Distribution ------------- count
< 0 | 0
0 |@@@@@@@@@@@@@@@ 2880
10 |@@@@@@@ 1280
20 |@@@@@ 990
30 |@@@@@ 920
40 |@@@@ 670
50 |@@@@ 730
60 | 0

The output is quite interesting, and illustrates neatly the behaviour of different scheduling classes.

The IA interactive class had 30 samples of a 50 to 59 priority, a fairly high priority. This class is used for interactive processes, such as the windowing system. I had clicked on a few windows to create this activity.

The SYS system class has had 4959 samples at a < 0 priority - the lowest, which was for the idle thread. There are a few samples at higher priorities, including some in the 160 to 169 range (the highest), which are for interrupt threads. The system class is used by the kernel.

The RT real time class had 110 samples in the 100 to 109 priority range. This class is designed for real-time applications, those that must have a consistant response time regardless of other process activity. For that reason, the RT class trumps both TS and IA. I created these events by running "prstat -R" as root, which runs prstat in the real time class.

The TS time sharing class is the default scheduling class for the processes on a Solaris system. I ran an infinite shell loop to create heavy activity, "while :; do :; done", which shows a profile that leans towards lower priorities. This is deliberate behaivour from the time sharing class, which reduces the priority of CPU bound processes so that they interefere less with I/O bound processes. The result is more samples in the lower priority ranges.

08 May, 2006

Ged - GUI-ed

I've just uploaded Ged to the Specials collection - it is a GUI front-end to the "ed" line editor, and has been written for Java 1.5 using Swing. It enhances "ed" in several ways, such as providing optional themes, sound effects, and a stunning splash screen rendered in POV-ray.[1]



ok, the real reason I'm coding in Java/Swing is to test drive the new Java 1.5 features and the Swing API. I've coded in Java before, however the last few years I've been using mostly Shell, Perl, C and DTrace. There are some really great features in Java 1.5 to try out. I'm also planning on writing some more freeware GUI-based programs; such as performance monitoring tools (DTrace) and Games.

In the past I've coded in OSF/Motif, GTK 2.0, Java/AWT and now Java/Swing. It's hard to choose a single winner - they each have different pros and cons; however I do like coding in both GTK and Swing.

For now, enjoy Ged. No, I didn't write "ed" itself in Java - it borrows /bin/ed. Of course - I could write "ed" entirerly in Java, which would make Ged more portable, but there are higher things on my todo list!

[1] which was then mutilated by downsampling to "classic" 2-bit colour.

25 April, 2006

Learn DTrace @ London

During the past five years I've delivered many training events across Australia and Asia; however this will be my first event in Europe.

I will be delivering two 3-day classes near the London area (Egham), from June 7th-9th and June 12th-14th, 2006. The website is here, and seats are currently available (but won't be forever).

These are special classes that will cover not only DTrace, but most importantly the "DTrace Mentality" - strategies used to tackle problems, and a workshop of mystery problems to practice on. I'll also discuss the DTraceToolkit and other performance tools.

There are currently no plans to run these classes again, so as far as I know - this is it.

I'm really looking forward to these events. And beforehand, please think of what problems have stumped you in the past on Solaris - especially statistics that you were unable to measure, so that you can ask me in person. If I can't answer it, I'll try to write the script that can. And if the script is useful, it may end up in the DTraceToolkit!
DTraceToolkit ver 0.96

I've just uploaded the latest build of DTraceToolkit, which now contains 104 scripts!

12 scripts have been added and 46 scripts were updated - this is a BIG revision. Since there have been so many new changes, I'm holding the version number below 1.00 until the dust has settled (I was keeping version number equal to the script count, however I'll hold back on that for a while).

This is the first rev to include a few scripts written by other people - Richard McDougall and Jonathan Adams, who can both write DTrace well and more importantly, have an exceptional understanding of subtle kernel nuances.

This rev has had another small style change (which is why so many scripts were updated). I've also began writing a document called the "DTraceToolkit Style Guide", which documents the style and programming best practices used by the scripts in the toolkit. I'll post more about that later.

Stefan Parvu helped out with platform testing, which is crucial. Some of the tcp scripts had began not working on newer builds (since they are fbt based, and fbt is not a stable interface (and not supposed to be)). They have been fixed (for now!).

As usual, check locations such as Docs/Examples for examples of the newly added scripts in action. Enjoy!

19 April, 2006

Tokyo, Japan

A few weeks ago I was in Tokyo to deliver a couple of Solaris 10 events for Sun. It was the time of year for cherry blossoms, and a great time to take photos. I've just added a series of them to the cityscapes on my website.