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.