<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-13965874</id><updated>2012-01-01T15:32:58.588-08:00</updated><title type='text'>The Wall</title><subtitle type='html'>Brendan Gregg's personal blog.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>41</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13965874.post-3217285476393385509</id><published>2011-12-31T23:24:00.000-08:00</published><updated>2012-01-01T00:48:14.920-08:00</updated><title type='text'>Still Writing</title><content type='html'>I haven't posted here in a few years, but I have been busy writing material, particularly for:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The &lt;a href="http://dtrace.org/blogs/brendan/2011/02/23/dtrace-book-sample-chapter-file-systems/"&gt;DTrace book&lt;/a&gt;: which has over 1,000 pages, much of it new content.  This ate over a year of my spare time (and Jim's).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://dtrace.org/blogs/brendan"&gt;dtrace.org/blogs/brendan&lt;/a&gt;: my professional blog, for posts related to my work (although it's still mostly a spare time project).  This was formerly on  blogs.oracle.com/brendan, and before that on  blogs.sun.com/brendan.&lt;/li&gt;&lt;/ul&gt;For more of my recent writing, I've updated a summary under the Documentation section on my &lt;a href="http://www.brendangregg.com/index.html#Documentation"&gt;homepage&lt;/a&gt;, which includes posts from my dtrace.org blog and other places.&lt;br /&gt;&lt;br /&gt;I'll post more here in the coming year: this blog is for purely personal posts and projects (like the DTraceToolkit).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-3217285476393385509?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/3217285476393385509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=3217285476393385509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/3217285476393385509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/3217285476393385509'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2011/12/still-writing.html' title='Still Writing'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-5396244068218656668</id><published>2008-06-24T08:23:00.000-07:00</published><updated>2008-06-24T08:41:24.304-07:00</updated><title type='text'>DTrace in New York</title><content type='html'>Back in February I gave several DTrace talks in New York, including one at the New York OpenSolaris User Group meeting (&lt;a href="http://opensolaris.org/os/project/nycosug/"&gt;NYCOSUG&lt;/a&gt;).  I used an updated slide deck and was asked to put the PDF on my blog; I think Isaac must have beaten me to it and put it &lt;a href="http://mediacast.sun.com/users/unixmd/media/dtrace_NYC.pdf"&gt;here&lt;/a&gt; (thanks!).  I did intend to blog about this in case anyone was looking - sorry for the delay.&lt;br /&gt;&lt;br /&gt;The NYCOSUG had a good turn out and asked some great questions, allowing me to deviate from the prepared slides and cover other things of interest (which is the value of an in-person presentation.)  After the presentation I realised there was one point I could have explained better, which would make an interesting blog post.&lt;br /&gt;&lt;br /&gt;I started with the following simple demos - the point of these is to build on something commonly understood (such as the behaviour of fork() and exec()), to introduce something new - DTrace.&lt;br /&gt;&lt;br /&gt;Tracing exec():&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;dtrace -n 'syscall::exec*: { trace(execname); }'&lt;/b&gt;&lt;br /&gt;dtrace: description 'syscall::exec*: ' matched 4 probes&lt;br /&gt;CPU     ID                    FUNCTION:NAME&lt;br /&gt;  0  98087                      exece:entry   bash                             &lt;br /&gt;  0  98088                     exece:return   ls                               &lt;br /&gt;^C&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the above output, we traced an exece() system call - printing the current process name when we entered and returned from that system call.  That process name changed from "bash" to "ls" (I executed "ls -l" in another window), which is what exec() does - replaces the current process image with another.&lt;br /&gt;&lt;br /&gt;While unsuprising, the significance is that we are able to dymanically trace this kernel activity whenever we would like, along with thousands of other kernel events.  I could, for example, trace the time taken for exec() to execute; or the exit status when exec() returned along with the error code; I can also trace the internal operation of exec() with enough detail to fill hundreds of pages (I just counted 47396 lines of output when tracing every kernel function entry and return during exec()).&lt;br /&gt;&lt;br /&gt;Now to trace fork():&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;dtrace -n 'syscall::fork*: { trace(pid); }'&lt;/b&gt;&lt;br /&gt;dtrace: description 'syscall::fork*: ' matched 6 probes&lt;br /&gt;CPU     ID                    FUNCTION:NAME&lt;br /&gt;  0  98227                    forksys:entry     87417&lt;br /&gt;  0  98228                   forksys:return     90769&lt;br /&gt;  0  98228                   forksys:return     87417&lt;br /&gt;^C&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above system call has one entry and two returns - which is what we expect from the fork() family.&lt;br /&gt;&lt;br /&gt;Simple as this is, some interesting behaviour is already visible.  Note that the parent returned before the child?  On the fork() entry, the parent's PID is traced (87417), however the child PID (90769) appears first on return.&lt;br /&gt;&lt;br /&gt;It's possible that the output could be shuffled due to how DTrace uses per-CPU buffers to minimise performance impact; to double check, add a "timestamp" column and post sort:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;dtrace -n 'syscall::fork*: { printf("%d %d", timestamp, pid); }' -o /tmp/out.dtrace&lt;/b&gt;&lt;br /&gt;dtrace: description 'syscall::fork*: ' matched 6 probes&lt;br /&gt;# &lt;b&gt;sort -n +3 /tmp/out.dtrace&lt;/b&gt;&lt;br /&gt;CPU     ID                    FUNCTION:NAME&lt;br /&gt;  1  98227                    forksys:entry 268361844462135 87417&lt;br /&gt;  1  98228                   forksys:return 268361844960455 90968&lt;br /&gt;  0  98228                   forksys:return 268361844965924 87417&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I asked the audience - why does the child return from fork() before the parent?  I added that this was a very difficult question!&lt;br /&gt;&lt;br /&gt;Someone responded to say that this was how all operating systems worked - the parent process waits for the child to complete.  I said I was just tracing fork() and the parent could be scheduled first - but deliberately isn't, and explained why.  My answer left them confused - and it struck me afterwards that I should have explained this better.&lt;br /&gt;&lt;br /&gt;Consider this:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;dtrace -n 'syscall::fork*:,syscall::wait*: { trace(pid); }'&lt;/b&gt;&lt;br /&gt;dtrace: description 'syscall::fork*:,syscall::wait*: ' matched 10 probes&lt;br /&gt;CPU     ID                    FUNCTION:NAME&lt;br /&gt;  0  98227                    forksys:entry    87417&lt;br /&gt;  0  98228                   forksys:return    91088&lt;br /&gt;  0  98228                   forksys:return    87417&lt;br /&gt;  0  98163                    waitsys:entry    87417&lt;br /&gt;  0  98164                   waitsys:return    87417&lt;br /&gt;^C&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the above output we can see both fork() and wait(), and we can discuss behaviour such as the parent process waiting for the child to complete (since I was in a shell running foreground commands.)&lt;br /&gt;&lt;br /&gt;But I was actually asking a much deeper question, that of thread scheduling immediately after the fork() system call, and &lt;i&gt;before&lt;/i&gt; the parent has called wait().  Immediately after fork() you have two threads - which should go on-CPU first?  The parent, so that it can get to wait() sooner and before the child may have exited?  Or is there a reason to schedule the child first?&lt;br /&gt;&lt;br /&gt;As DTrace shows, the child is getting scheduled first, and the reason is one of performance.  The source code explains in &lt;a href="http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/disp/ts.c"&gt;uts/common/disp/ts.c&lt;/a&gt; :&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt; * Child is placed at back of dispatcher queue and parent gives&lt;br /&gt; * up processor so that the child runs first after the fork.&lt;br /&gt; * This allows the child immediately execing to break the multiple&lt;br /&gt; * use of copy on write pages with no disk home. The parent will&lt;br /&gt; * get to steal them back rather than uselessly copying them.&lt;br /&gt; */&lt;br /&gt;static void&lt;br /&gt;ts_forkret(kthread_t *t, kthread_t *ct)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The fork() system call creates a clone of the parent, but rather than copy all memory pages to a new address space (which would add significant latency during process creation), Solaris bumps a reference counter on those memory pages to remember that two process refer to the same data.  If one writes to a memory page later, this triggers a "copy on write" to create a private writable copy for that process.  This means that expensive memory copies are only performed when needed - or if needed.  Since a child process is likely to call exec(), it is likely to simply drop many existing memory references for the new process image, so copying those bytes would have been wasted cycles anyway.&lt;br /&gt;&lt;br /&gt;However if the parent is scheduled first - before the child has had a chance to exec() - then the parent may continue writing to its address space, triggering copy on writes.  Then the child executes, calls exec(), and drops those newly copied pages anyway - which were copied in vain.  To avoid this, the child is scheduled first - to call exec() as soon as possible, as described in the comment above.&lt;br /&gt;&lt;br /&gt;I learned about this behaviour when reading Solaris Internals 1st edition; but that was a time before DTrace and OpenSolaris.  It's great that we all can now both read the code, and use DTrace to see it in operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-5396244068218656668?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/5396244068218656668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=5396244068218656668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/5396244068218656668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/5396244068218656668'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2008/06/dtrace-in-new-york.html' title='DTrace in New York'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-7808836107211924980</id><published>2008-02-18T01:19:00.002-08:00</published><updated>2008-02-18T02:56:52.396-08:00</updated><title type='text'>DTraceToolkit in MacOS X</title><content type='html'>Apple included DTrace in MacOS X 10.5 (Leopard), released in October 2007.  It's great to have DTrace available in MacOS X for its powerful application and kernel performance analysis.  To think that there is now another kernel we can examine using DTrace is exciting - it's like discovering a new planet in the solar system.&lt;br /&gt;&lt;br /&gt;Apart from kernel analysis, DTrace also improves general usability by answering every day questions like: why are my disks rattling? or why does my browser keep hanging?  Although, your average user may not write DTrace scripts to answer these questions themselves (it's better if they do), but instead use prewritten scripts.&lt;br /&gt;&lt;br /&gt;MacOS X includes a collection of DTrace scripts in &lt;b&gt;/usr/bin&lt;/b&gt;, mostly from the &lt;a href="http://www.brendangregg.com/dtrace.html#DTraceToolkit"&gt;DTraceToolkit&lt;/a&gt;:&lt;br /&gt;&lt;pre&gt;leopard# &lt;b&gt;grep -l DTrace /usr/bin/*&lt;/b&gt;&lt;br /&gt;/usr/bin/bitesize.d&lt;br /&gt;/usr/bin/cpuwalk.d&lt;br /&gt;/usr/bin/creatbyproc.d&lt;br /&gt;/usr/bin/dappprof&lt;br /&gt;/usr/bin/dapptrace&lt;br /&gt;/usr/bin/diskhits&lt;br /&gt;/usr/bin/dispqlen.d&lt;br /&gt;/usr/bin/dtruss&lt;br /&gt;/usr/bin/errinfo&lt;br /&gt;/usr/bin/execsnoop&lt;br /&gt;/usr/bin/fddist&lt;br /&gt;/usr/bin/filebyproc.d&lt;br /&gt;/usr/bin/hotspot.d&lt;br /&gt;/usr/bin/httpdstat.d&lt;br /&gt;/usr/bin/iofile.d&lt;br /&gt;/usr/bin/iofileb.d&lt;br /&gt;/usr/bin/iopattern&lt;br /&gt;/usr/bin/iopending&lt;br /&gt;/usr/bin/iosnoop&lt;br /&gt;/usr/bin/iotop&lt;br /&gt;/usr/bin/kill.d&lt;br /&gt;/usr/bin/lastwords&lt;br /&gt;/usr/bin/loads.d&lt;br /&gt;/usr/bin/newproc.d&lt;br /&gt;/usr/bin/opensnoop&lt;br /&gt;/usr/bin/pathopens.d&lt;br /&gt;/usr/bin/pidpersec.d&lt;br /&gt;/usr/bin/plockstat&lt;br /&gt;/usr/bin/priclass.d&lt;br /&gt;/usr/bin/pridist.d&lt;br /&gt;/usr/bin/procsystime&lt;br /&gt;/usr/bin/runocc.d&lt;br /&gt;/usr/bin/rwbypid.d&lt;br /&gt;/usr/bin/rwbytype.d&lt;br /&gt;/usr/bin/rwsnoop&lt;br /&gt;/usr/bin/sampleproc&lt;br /&gt;/usr/bin/seeksize.d&lt;br /&gt;/usr/bin/setuids.d&lt;br /&gt;/usr/bin/sigdist.d&lt;br /&gt;/usr/bin/syscallbypid.d&lt;br /&gt;/usr/bin/syscallbyproc.d&lt;br /&gt;/usr/bin/syscallbysysc.d&lt;br /&gt;/usr/bin/topsyscall&lt;br /&gt;/usr/bin/topsysproc&lt;br /&gt;/usr/bin/weblatency.d&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's 44 DTraceToolkit scripts, plus plockstat from Solaris 10.  While the DTraceToolkit now has over 200 scripts, it makes sense to pick out the most useful scripts for inclusion in /usr/bin.  &lt;br /&gt;&lt;br /&gt;Popular scripts such as iosnoop can now be run by MacOS X users:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;leopard# &lt;b&gt;iosnoop&lt;/b&gt;&lt;br /&gt;  UID   PID D    BLOCK   SIZE       COMM PATHNAME&lt;br /&gt;  501   130 R 31987472  40960   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R  7879952   8192   Terminal ??/SearchManager.nib/keyedobjects.nib&lt;br /&gt;  501   130 R 32132304  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32132528   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32047696  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32132592   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32131512  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32033296  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32044488   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32045064   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32131344   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32048680  16384   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32132544   8192   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32049296  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;   -1     0 W 32482848  86016 kernel_task ??/vm/swapfile2&lt;br /&gt;   -1     0 W 32483040 135168 kernel_task ??/vm/swapfile2&lt;br /&gt;  501   130 R 32044672   4096   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;  501   130 R 32132656  12288   Terminal ??/dyld/dyld_shared_cache_i386&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The man pages are conveniently included in &lt;b&gt;/usr/share/man&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;I had been making preperations in the latest DTraceToolkit (0.99) for MacOS X DTrace, such as putting an "OS" field into the man pages and figuring out how to support different versions of the same script (tcpsnoop_snv, etc).  Hopefully many scripts will run on both Solaris and MacOS X (especially if they use stable providers), however I expect there will be some that are specific to each.  Now that QNX DTrace also exists, there is additional need for identifying OS specifics in the DTraceToolkit.&lt;br /&gt;&lt;br /&gt;It's been great news for DTrace, Sun and Apple - who have not only gained the best performance and debugging tool available, but also the existing DTrace community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-7808836107211924980?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/7808836107211924980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=7808836107211924980' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/7808836107211924980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/7808836107211924980'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2008/02/dtracetoolkit-in-macos-x.html' title='DTraceToolkit in MacOS X'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-930977648897046476</id><published>2008-02-17T23:19:00.002-08:00</published><updated>2008-02-18T00:32:39.723-08:00</updated><title type='text'>Browsable DTraceToolkit</title><content type='html'>&lt;a href="http://stefanparvu.blogspot.com/"&gt;Stefan Parvu&lt;/a&gt; has created browsable HTML versions of the &lt;a href="http://www.brendangregg.com/dtrace.html#DTraceToolkit"&gt;DTraceToolkit&lt;/a&gt; on the &lt;a href="http://www.nbl.fi/~nbl97/solaris/dtrace/dtt_testing.html"&gt;DTT test page&lt;/a&gt;.   See &lt;a href="http://www.nbl.fi/~nbl97/solaris/dtrace/099html/dtt099.html"&gt;DTraceToolkit ver 0.99&lt;/a&gt; to browse that version. &lt;br /&gt;&lt;br /&gt;A goal of the DTraceToolkit is to provide documented examples of DTrace scripting, in addition to what is available in the &lt;a href="http://wikis.sun.com/display/DTrace/Documentation"&gt;DTrace Guide&lt;/a&gt;.  However these examples have been reaching a limited audience of those who download, unzip, and browse through the text files.&lt;br /&gt;&lt;br /&gt;Now that the DTraceToolkit is browsable online, its contents can be found by internet search engines.  This should help people not only find examples of DTrace usage, but also solutions to some common observability problems.&lt;br /&gt;&lt;br /&gt;There have been a few other items of DTraceToolkit news which I'll blog about soon.  Please excuse my infrequent blog postings - I've been busy since joining Sun on a particular project which consumes most of my spare time.  It will be worth it, which should be clear once I can start posting about it on my &lt;a href="http://blogs.sun.com/brendan"&gt;Sun blog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-930977648897046476?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/930977648897046476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=930977648897046476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/930977648897046476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/930977648897046476'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2008/02/browsable-dtracetoolkit.html' title='Browsable DTraceToolkit'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-4034769704765156208</id><published>2007-10-05T23:13:00.000-07:00</published><updated>2007-10-06T21:07:08.745-07:00</updated><title type='text'>DTraceToolkit ver 0.99</title><content type='html'>I've released &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit ver 0.99&lt;/a&gt; - a major release. If you haven't encountered it before, the DTraceToolkit is a collection of opensource scripts for:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;solving various troubleshooting and performance issues&lt;/li&gt;&lt;li&gt;demonstrating what is possible with DTrace (seeing is believing)&lt;/li&gt;&lt;li&gt;learing DTrace by example&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The DTraceToolkit isn't Sun's standard set of Solaris performance tools, or, everything that DTrace can do. It is a handy collection of documented and tested DTrace tools that are useful in most situations. It's certainly not a substitute for learning DTrace properly and writing your own custom scripts - although it should help you do that by providing working examples of code. It is certainly better than not using DTrace at all, if you didn't have the time to learn DTrace.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DTraceToolkit 0.96&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;18 months ago I released version 0.96 of the DTraceToolkit.  The Bin directory, which contains symlinks to all the scripts, looked like this,&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GPwYZKqRp84/Rwc4VUA8J6I/AAAAAAAAAAU/2ba-6x37yXY/s1600-h/Bin096_01c.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_GPwYZKqRp84/Rwc4VUA8J6I/AAAAAAAAAAU/2ba-6x37yXY/s400/Bin096_01c.png" alt="" id="BLOGGER_PHOTO_ID_5118121440330917794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;center&gt;&lt;i&gt;DTraceToolkit version 0.96&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;Click for a larger image.  That collection of scripts provides various views of system behaviour and of the interaction of applications with the system.  A general theme, if there was one, was that of easy system observability - illuminating system internals that were either difficult or impossible to see before.  There were 104 scripts in that release - although that is just the tip of an iceberg.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DTraceToolkit 0.99&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the last 18 months, DTrace has been expanding its horizons through the creation of numerous new DTrace providers.  There are now providers for Java, JavaScript, Perl, Python, Php, Ruby, Shell and Tcl, and more on the way.  The iceberg of system observability is now just one in a field of icebergs, with more rising above the surface as time goes by.  It's about time the DTraceToolkit was updated to refelect the trajectory of DTrace itself - which isn't just about system observability - it is the observability of life, the universe, and everything.&lt;br /&gt;&lt;br /&gt;This new version of the DTraceToolkit does has a theme - that of programing language visibility, which covers several of the new DTrace providers that now exist.  The Bin directory of the toolkit now contains 230 scripts, and looks like,&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GPwYZKqRp84/RwdAdkA8J7I/AAAAAAAAAAc/DdnHTwTZuPM/s1600-h/Bin099_01c.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_GPwYZKqRp84/RwdAdkA8J7I/AAAAAAAAAAc/DdnHTwTZuPM/s400/Bin099_01c.png" alt="" id="BLOGGER_PHOTO_ID_5118130378157860786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Below I've highlighted most of the new contents, grouped by language that they trace,&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GPwYZKqRp84/RwdA8kA8J8I/AAAAAAAAAAk/moG5on5wFFU/s1600-h/Bin099_04c.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_GPwYZKqRp84/RwdA8kA8J8I/AAAAAAAAAAk/moG5on5wFFU/s400/Bin099_04c.png" alt="" id="BLOGGER_PHOTO_ID_5118130910733805506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;center&gt;&lt;i&gt;DTraceToolkit version 0.99&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;I've placed language scripts in their own subdirectories, each of which include a "Readme" file to document suggestions for where to find the provider and how to get it installed and working.  Some of these providers do require downloading of source, patching, and compiling, which may take you some time. Both C and C++ are supported by numerous scripts, but don't have a prefix to group them like the other languages do; I hope to fix this in the next release, and actually have C and C++ subdirectories.&lt;br /&gt;&lt;br /&gt;DTraceToolkit 0.99 change summary:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New script categories: Java, JavaScript, Perl, Php, Python, Ruby, Shell and Tcl&lt;/li&gt;&lt;li&gt;Many new scripts (script count has doubled)&lt;/li&gt;&lt;li&gt;Many new example files (since there is one per script)&lt;/li&gt;&lt;li&gt;A new Code directory for sample target code (used by the example files)&lt;/li&gt;&lt;li&gt;Several bug fixes, numerous updates&lt;/li&gt;&lt;li&gt;Updated versions of tcpsnoop/tcptop for OpenSolaris/Solaris Nevada circa late 2007&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For each language, there is about a dozen scripts to provide:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;general observability (such as function and object counts, function flows)&lt;/li&gt;&lt;li&gt;performance observability (on-cpu/elapsed times, function inclusive/exclusive times, memory allocation)&lt;/li&gt;&lt;li&gt;some paths for deeper analysis (syscall and library tracing, stacks, etc)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Screenshots&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now for some examples. I'll demonstrate PHP, but the following applies to all the new languages supported in the toolkit (look in the Example directory for the language that interests you). Here is a sample PHP program that appears in the toolkit as Code/Php/func_abc.php,&lt;br /&gt;&lt;pre&gt;/opt/DTT&gt; &lt;b&gt;cat -n Code/Php/func_abc.php &lt;/b&gt;&lt;br /&gt;  1  &amp;lt;?php&lt;br /&gt;  2  function func_c()&lt;br /&gt;  3  {&lt;br /&gt;  4          echo "Function C\n";&lt;br /&gt;  5          sleep(1);&lt;br /&gt;  6  }&lt;br /&gt;  7&lt;br /&gt;  8  function func_b()&lt;br /&gt;  9  {&lt;br /&gt; 10          echo "Function B\n";&lt;br /&gt; 11          sleep(1);&lt;br /&gt; 12          func_c();&lt;br /&gt; 13  }&lt;br /&gt; 14&lt;br /&gt; 15  function func_a()&lt;br /&gt; 16  {&lt;br /&gt; 17          echo "Function A\n";&lt;br /&gt; 18          sleep(1);&lt;br /&gt; 19          func_b();&lt;br /&gt; 20  }&lt;br /&gt; 21&lt;br /&gt; 22  func_a();&lt;br /&gt; 23  ?&amp;gt;&lt;/pre&gt;&lt;br /&gt;For general observability there are scripts such as php_funccalls.php, for counting function calls,&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;php_funccalls.d &lt;/b&gt;&lt;br /&gt;Tracing... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt;FILE                             FUNC                                CALLS&lt;br /&gt;func_abc.php                     func_a                                  1&lt;br /&gt;func_abc.php                     func_b                                  1&lt;br /&gt;func_abc.php                     func_c                                  1&lt;br /&gt;func_abc.php                     sleep                                   3&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above output showed that sleep() was called three times, and the user defined functions were each called once - as we would have assumed from the source. With DTrace you can check your assumptions through tracing, which is often a useful excercise. I've solved many performance issues by examining areas that seem almost too obvious to bother checking.&lt;br /&gt;&lt;br /&gt;The following script is both for general and performance observability. It prints function flow along with delta times,&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;php_flowtime.d&lt;/b&gt;&lt;br /&gt;  C TIME(us)         FILE             DELTA(us)  -- FUNC&lt;br /&gt;  0 3646108339057    func_abc.php             9 -&gt; func_a&lt;br /&gt;  0 3646108339090    func_abc.php            32   -&gt; sleep&lt;br /&gt;  0 3646109341043    func_abc.php       1001953   &lt;- sleep&lt;br /&gt;  0 3646109341074    func_abc.php            31   -&gt; func_b&lt;br /&gt;  0 3646109341098    func_abc.php            23     -&gt; sleep&lt;br /&gt;  0 3646110350712    func_abc.php       1009614     &lt;- sleep&lt;br /&gt;  0 3646110350745    func_abc.php            32     -&gt; func_c&lt;br /&gt;  0 3646110350768    func_abc.php            23       -&gt; sleep&lt;br /&gt;  0 3646111362323    func_abc.php       1011554       &lt;- sleep&lt;br /&gt;  0 3646111362351    func_abc.php            27     &lt;- func_c&lt;br /&gt;  0 3646111362361    func_abc.php            10   &lt;- func_b&lt;br /&gt;  0 3646111362370    func_abc.php             9 &lt;- func_a&lt;br /&gt;^C &lt;/pre&gt;&lt;br /&gt;Delta times, in this case, show the time from the line on which they appear to the previous line. The large delta times visible show that from when the sleep() function completed to when it began, took around 1.0 seconds of elapsed time. As we'd expect from the source. Both CPU (C) and time since boot (TIME(us)) are printed in case the output is shuffled on multi-CPU systems, and requires post sorting.&lt;br /&gt;&lt;br /&gt;A more consise way to examine elapsed times may be php_calltime.d, a script that can be useful for performance analysis,&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;php_calltime.d&lt;/b&gt;&lt;br /&gt;Tracing... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;Count,&lt;br /&gt;FILE                 TYPE       NAME                                COUNT&lt;br /&gt;func_abc.php         func       func_a                                  1&lt;br /&gt;func_abc.php         func       func_b                                  1&lt;br /&gt;func_abc.php         func       func_c                                  1&lt;br /&gt;func_abc.php         func       sleep                                   3&lt;br /&gt;-                    total      -                                       6&lt;br /&gt;&lt;br /&gt;Exclusive function elapsed times (us),&lt;br /&gt;FILE                 TYPE       NAME                                TOTAL&lt;br /&gt;func_abc.php         func       func_c                                330&lt;br /&gt;func_abc.php         func       func_b                                367&lt;br /&gt;func_abc.php         func       func_a                                418&lt;br /&gt;func_abc.php         func       sleep                             3025644&lt;br /&gt;-                    total      -                                 3026761&lt;br /&gt;&lt;br /&gt;Inclusive function elapsed times (us),&lt;br /&gt;FILE                 TYPE       NAME                                TOTAL&lt;br /&gt;func_abc.php         func       func_c                            1010119&lt;br /&gt;func_abc.php         func       func_b                            2020118&lt;br /&gt;func_abc.php         func       sleep                             3025644&lt;br /&gt;func_abc.php         func       func_a                            3026761&lt;/pre&gt;&lt;br /&gt;The exclusive function elapsed times show which functions cused the latency - which identifies sleep() clocking a total of 3.0 seconds (as it was called three times). The inclusive times show which higher level functions the latency occured in, the largest being func_a() since every other function were called within it. There isn't a total line printed for inclusive times - since it wouldn't make much sense to do so (that column sums to 9 seconds, which is more confusing than of actual use).&lt;br /&gt;&lt;br /&gt;As a starting point for deeper analysis, the following script adds syscall tracing to the PHP function flows, and adds terminal escape colours (see Notes/ALLcolors_notes.txt for notes on using colors with DTrace),&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;php_syscolors.d&lt;/b&gt;&lt;br /&gt;C    PID/TID   DELTA(us)              FILE:LINE TYPE     -- NAME&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1             8      func_abc.php:22   func     -&amp;gt; func_a&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            41      func_abc.php:18   func       -&amp;gt; sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            15                 ":-    syscall      -&amp;gt; nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1       1008700                 ":-    syscall      &amp;lt;- nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            30      func_abc.php:18   func       &amp;lt;- sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            42      func_abc.php:19   func       -&amp;gt; func_b&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            28      func_abc.php:11   func         -&amp;gt; sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            14                 ":-    syscall        -&amp;gt; nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1       1010083                 ":-    syscall        &amp;lt;- nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            29      func_abc.php:11   func         &amp;lt;- sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            43      func_abc.php:12   func         -&amp;gt; func_c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            28      func_abc.php:5    func           -&amp;gt; sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            14                 ":-    syscall          -&amp;gt; nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1       1009794                 ":-    syscall          &amp;lt;- nanosleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            28      func_abc.php:5    func           &amp;lt;- sleep&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            34      func_abc.php:6    func         &amp;lt;- func_c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            18      func_abc.php:13   func       &amp;lt;- func_b&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(160, 0, 160);"&gt;0  18426/1            17      func_abc.php:20   func     &amp;lt;- func_a&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            21                 ":-    syscall  -&amp;gt; fchdir&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            19                 ":-    syscall  &amp;lt;- fchdir&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1             9                 ":-    syscall  -&amp;gt; close&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            13                 ":-    syscall  &amp;lt;- close&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            35                 ":-    syscall  -&amp;gt; semsys&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            12                 ":-    syscall  &amp;lt;- semsys&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1             7                 ":-    syscall  -&amp;gt; semsys&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1             7                 ":-    syscall  &amp;lt;- semsys&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            66                 ":-    syscall  -&amp;gt; setitimer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1             8                 ":-    syscall  &amp;lt;- setitimer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            39                 ":-    syscall  -&amp;gt; read&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            14                 ":-    syscall  &amp;lt;- read&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            11                 ":-    syscall  -&amp;gt; writev&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            22                 ":-    syscall  &amp;lt;- writev&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            23                 ":-    syscall  -&amp;gt; write&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1           110                 ":-    syscall  &amp;lt;- write&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 160, 0);"&gt;0  18426/1            61                 ":-    syscall  -&amp;gt; pollsys&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;From that output we can see that PHP's sleep() is implemented by the syscall nanosleep(), and that it appears that writes are buffered and written later.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Understanding the language scripts&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The scripts are potentially confusing for a couple of reasons; understanding these will help explain how best to use these scripts.&lt;br /&gt;&lt;br /&gt;Firstly, some of the scripts print out an event "TYPE" field (eg, "syscall" or "func"), and yet the script only traces one type of event (eg, "func"). Why print a field that will always contain the same data? Sounds like it might be a copy-n-paste error. This is in fact deliberate so that the scripts form better templates for expansion, and was something I learnt while using the scripts to analyse a variety of problems. I would frequently have a script that measured functions and wanted to add syscalls, library calls or kernel events, to customise that script for a particular problem. When adding these other event types, it was much easier (often trivial) if the script already had a "TYPE" field. So now most of them do.&lt;br /&gt;&lt;br /&gt;Also, there are variants of scripts that provide very similar tracing at different depths of detail. Why not one script that does everything, with the most detail? Here I'll use the Tcl provider to explain why,&lt;br /&gt;&lt;br /&gt;The tcl_proccalls.d script counts procedure calls, here it is tracing the Code/Tcl/func_slow.tcl program in the toolkit, which calls loops within functions:&lt;br /&gt;&lt;pre&gt;&lt;b&gt;# tcl_proccalls.d&lt;/b&gt;&lt;br /&gt;Tracing... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt; PID    COUNT PROCEDURE&lt;br /&gt;183083        1 func_a&lt;br /&gt;183083        1 func_b&lt;br /&gt;183083        1 func_c&lt;br /&gt;183083        1 tclInit&lt;/pre&gt;&lt;br /&gt;Ok, that's a very high level view of Tcl activity. There is also tcl_calls.d to count Tcl commands as well as procedures:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;tcl_calls.d&lt;/b&gt;&lt;br /&gt;Tracing... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt; PID TYPE     NAME                                                    COUNT&lt;br /&gt;[...]&lt;br /&gt;183086 proc     func_a                                                      1&lt;br /&gt;183086 proc     func_b                                                      1&lt;br /&gt;183086 proc     func_c                                                      1&lt;br /&gt;183086 proc     tclInit                                                     1&lt;br /&gt;[...]&lt;br /&gt;183086 cmd      if                                                          8&lt;br /&gt;183086 cmd      info                                                       11&lt;br /&gt;183086 cmd      file                                                       12&lt;br /&gt;183086 cmd      proc                                                       12&lt;/pre&gt;&lt;br /&gt;(Output truncated). Now we have a deeper view of Tcl operation. Finally there is tcl_ins.d to count Tcl instructions:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;tcl_ins.d&lt;/b&gt;&lt;br /&gt;Tracing... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt; PID TYPE     NAME                                                    COUNT&lt;br /&gt;[...]&lt;br /&gt;16005 inst     jump1                                                      14&lt;br /&gt;16005 inst     pop                                                        18&lt;br /&gt;16005 inst     invokeStk1                                                 53&lt;br /&gt;16005 inst     add                                                    600000&lt;br /&gt;16005 inst     concat1                                                600000&lt;br /&gt;16005 inst     exprStk                                                600000&lt;br /&gt;16005 inst     lt                                                     600007&lt;br /&gt;16005 inst     storeScalar1                                           600016&lt;br /&gt;16005 inst     done                                                   600021&lt;br /&gt;16005 inst     loadScalar1                                           1200020&lt;br /&gt;16005 inst     push1                                                 4200193&lt;/pre&gt;&lt;br /&gt;There are such large counts since this script is tracing the low level instructions used to execute the loops in this code.&lt;br /&gt;&lt;br /&gt;So the question is: why three scripts and not one that counts everything? Why not tcl_megacount.d? There are at least three reasons behind this.&lt;br /&gt;&lt;br /&gt;1. You don't pull out a microscope if you are looking for your umbrella. Tracing everything can really bog you down in detail, when higher level views are frequently sufficient for solving issues. It's a matter of the right tool for the job. Try the higher level scripts first, then dig deeper as needed.&lt;br /&gt;&lt;br /&gt;2. Measuring at such a low level can have a significant performance impact. I'll demonstrate this by using &lt;tt&gt;ptime&lt;/tt&gt; as a easy (but rough) measurement of run time for the Code/Tcl/func_slow.tcl sample program.&lt;br /&gt;&lt;br /&gt;Here is func_slow.tcl running with no DTrace enabled as a baseline:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;ptime ./func_slow.tcl &gt; /dev/null&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;real        3.306&lt;br /&gt;user        3.276&lt;br /&gt;sys         0.005&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now while tcl_proccalls.d is tracing procedure calls:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;ptime ./func_slow.tcl &gt; /dev/null&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;real        3.311&lt;br /&gt;user        3.270&lt;br /&gt;sys         0.006&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now while tcl_calls.d is tracing both Tcl procedures and commands:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt; ptime ./func_slow.tcl &gt; /dev/null&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;real        3.313&lt;br /&gt;user        3.283&lt;br /&gt;sys         0.006&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally with tcl_ins.d tracing Tcl instructions:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;ptime ./func_slow.tcl &gt; /dev/null&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;real       20.438&lt;br /&gt;user       20.278&lt;br /&gt;sys         0.010&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ow! Our target application is running 7 times slower? This isn't supposed to happen, is there something wrong with DTrace or the Tcl provider? Well, there isn't, the problem is that of tracing 9 million events during a 3 second program. The overheads of DTrace are miniscule, however if you multiply them (or anything) by ridiculously large numbers they'll eventually become measurable.  9 million events is a lot of events - and you wouldn't normally care about tracing Tcl instructions anyway. It's great to have this capability, if it is ever needed.&lt;br /&gt;&lt;br /&gt;3. Example programs. Writing mega powerful DTrace scripts often means mega confusing scripts to read. People use the DTraceToolkit as a collection of example code to learn from, so keeping things simple if possible, should help.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Documentation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It usually takes more time to document a script than it takes to write it. I feel strongly about creating quality IT documentation, so I'm reluctant to skip this step. The strategy used in the toolkit is, by subdirectory name,&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Scripts - these have a standard header plus inline comments.&lt;/li&gt;&lt;li&gt;Examples - this is a directory of example files that demonstrate each script, providing screenshots and interpretations of the output. Particular attention has been made to explain relevant details, especially caveats, no matter how obvious they may seem.&lt;/li&gt;&lt;li&gt;Notes - this is a directory of files that comment on a variety of topics that are relevant to multiple scripts. There are many more notes files in this toolkit release.&lt;/li&gt;&lt;li&gt;Man pages - there is a directory for these, which are useful for looking up field definitions and units. To be honest, I frequently use the Examples directory for reminders on what each tool does rather than the Man pages.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Since there were over 100 new scripts in this release, over 100 new example files needed to be written. Fortunately I had help from Claire Black (my wife), who as an ex-SysAdmin and Solaris Instructor had an excellent background for what people needed to know and how to express it. Unfortunately for her, she only had about 4 days from when I completed these scripts to when the documentation was due for inclusion on the next OpenSolaris Starter Kit disc. Despite the time constraint she has done a great job, and there is always the next release for her to spend more time fleshing out the examples further. I'm also aiming to collect more real-world example outputs for the next release (eg, Mediawiki analysis for the PHP scripts).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Testing&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Stefan Parvu has helped out again by running every script on a variety of platforms, which is especially important now that I don't have a SPARC server at the moment. He has posted the results on the &lt;a href="http://www.nbl.fi/%7Enbl97/solaris/dtrace/dtt_testing.html"&gt;DTraceToolkit Testing Room&lt;/a&gt;, and did find a few bugs which I fixed before release.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Personal&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It has been about 18 months since the last release.  In case anyone was wondering, there are several reasons why, briefly: I moved to the US, began a new job in Sun engineering, left most of my development servers behind in Australia, brought the DTraceToolkit dev environment over on a SPARC UFS harddisk (which I still can't read), and got hung up on what to do with the fragile tcp* scripts.  The main reason would be having less spare time as I learnt the ways of Sun engineering.&lt;br /&gt;&lt;br /&gt;I also have a Sun blog now, &lt;a href="http://blogs.sun.com/brendan"&gt;here&lt;/a&gt;. I'm not announcing the DTraceToolkit there since it isn't a Sun project; it's a spare time project by myself and others of the OpenSolaris community.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Future&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The theme for the next release may be storage: I'd like to spend some time seeing what can be done for ZFS, for iSCSI (using the new provider), and NFS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-4034769704765156208?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/4034769704765156208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=4034769704765156208' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/4034769704765156208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/4034769704765156208'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2007/10/dtracetoolkit-ver-099.html' title='DTraceToolkit ver 0.99'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GPwYZKqRp84/Rwc4VUA8J6I/AAAAAAAAAAU/2ba-6x37yXY/s72-c/Bin096_01c.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-116609094298660591</id><published>2006-12-14T00:00:00.000-08:00</published><updated>2007-03-20T19:48:46.062-07:00</updated><title type='text'>Updates from California</title><content type='html'>Since I've been quiet for a while on this blog and on &lt;a href="http://www.opensolaris.org"&gt;OpenSolaris&lt;/a&gt; mailing lists, here is a quick update about myself and my projects.&lt;br /&gt;&lt;br /&gt;I got married, ditched my old &lt;a href="http://www.brendangregg.com/Perf/solarismetrics.html"&gt;car&lt;/a&gt;, left the instructing/consulting scene in Australia/APAC, and moved to California to work as a developer at Sun. I brought along whatever I could fit in airline luggage, which included a laptop, hard disks, some books, clothes, and my fencing gear. Since then, I've been busy getting up to speed with some interesting projects, some of which I've discussed on my Sun &lt;a href="http://blogs.sun.com/brendan"&gt;blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;OpenSolaris projects such as the &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt; will remain OpenSolaris projects; and other open source projects such as &lt;a href="http://www.brendangregg.com/chaosreader.html"&gt;Chaosreader&lt;/a&gt; will of course remain open source. I'll post updates about them to this blog and will continue working on them as I always have done - as a spare time hobby.&lt;br /&gt;&lt;br /&gt;Progress on these other projects has been on hold since I left Australia and powered down my array of test and development servers (and sadly powered down "mars", my main server which had an uptime of over 400 days). I began rebuilding my development environment last night, when I powered on the disk containing the DTraceToolkit build files for the first time in three months. I'm looking forward to adding some more scripts, and more documentation to guide people through the toolkit.&lt;br /&gt;&lt;br /&gt;And finally, living in the US has been great - however the following items were quite difficult to find: &lt;ol&gt;&lt;li&gt;cricket coverage&lt;/li&gt;&lt;li&gt;authentic ginger beer&lt;/li&gt;&lt;/ol&gt; I can now listen to Star 101.3 again, but I've lost access to both the ABC and BBC's online radio coverage of the Ashes Cricket series - which seems to be blocked from the US!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-116609094298660591?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/116609094298660591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=116609094298660591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/116609094298660591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/116609094298660591'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/12/updates-from-california.html' title='Updates from California'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115553291631703565</id><published>2006-08-13T22:03:00.000-07:00</published><updated>2006-08-13T22:23:13.796-07:00</updated><title type='text'>No more Star 101.3</title><content type='html'>If you are in Australia, that is.&lt;br /&gt;&lt;br /&gt;Sometime last year I went looking for a decent Internet radio station, as I'm often online on my laptop, but not ofter near radios or reliable reception. I found &lt;a href="http://www.star1013fm.com/listenlive.html"&gt;Star 101.3 FM&lt;/a&gt;, and it was good. It happens to be based in the US.&lt;br /&gt;&lt;br /&gt;My day would often begin with info bytes from John Tesh followed by hours of music (ok, sometimes they play the same music ;-). When I'd hear "Don Bleu in the morning", I'd know I'd stayed up a bit too late!&lt;br /&gt;&lt;br /&gt;Recently Star 101.3 pulled the plug for international listeners "due to licensing restrictions". Ok, I can understand that may well be the case, and I'm glad it lasted as long as it did. If you are in the US you can still listen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115553291631703565?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115553291631703565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115553291631703565' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115553291631703565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115553291631703565'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/08/no-more-star-1013.html' title='No more Star 101.3'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115545607104851101</id><published>2006-08-13T00:38:00.000-07:00</published><updated>2006-08-13T01:01:11.060-07:00</updated><title type='text'>Brendan Clones #2</title><content type='html'>Several months ago several of the Brendan clones were &lt;a href="http://bdgregg.blogspot.com/2006/01/brendan-clones-recently-james-dickens.html"&gt;photographed&lt;/a&gt; while working on the &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;More recently they were photographed again, this time working on &lt;a href="http://www.sun.com/books/catalog/solaris_internals.xml"&gt;Solaris Internals&lt;/a&gt; and &lt;a href="http://www.sun.com/books/catalog/solaris_perf_tools.xml"&gt;Solaris Performance and Tools&lt;/a&gt;. For the first time all of the Brendan clones were involved on the one project, with most of them pictured here. Click for a larger photo:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.brendangregg.com/Photos/Misc/brendan_clones02.jpg"&gt;&lt;img src="http://www.brendangregg.com/Photos/Misc/sml_brendan_clones02.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sleeping Brendan is busy sleeping, Engineer Brendan is studying Solaris Internals 1st edition, and Master Brendan is looking on. The remaining Brendans are meticulously checking facts, reading source code, writing DTrace scripts and testing them.&lt;br /&gt;&lt;br /&gt;Of course, photographer Brendan is behind the camera, taking the photo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115545607104851101?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115545607104851101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115545607104851101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115545607104851101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115545607104851101'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/08/brendan-clones-2.html' title='Brendan Clones #2'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115531622920974749</id><published>2006-08-11T07:28:00.000-07:00</published><updated>2006-08-11T10:15:03.166-07:00</updated><title type='text'>How much CPU does a down interface chew?</title><content type='html'>While teaching a DTrace class in Sydney this week I ran an ad-lib demo that took a mysterous and suprising turn. I think you'll find this quite interesting.&lt;br /&gt;&lt;br /&gt;One of my favourite DTrace demos begins by asking how much CPU a busy network interface will consume. About 2 in 10 people will know the answer - a lot! But how did you measure this on older Solaris? After all, if it really is "a lot", then we really want a value! 20% of a CPU? 50%?&lt;br /&gt;&lt;br /&gt;I was demonstrating on an Ultra 10, with a 333 MHz CPU and a 100 Mbit/sec interface (hme0). Even with the numerous TCP/IP performance enhancements in Solaris 10, driving 100 Mbit/sec on an Ultra 10 will still hurt.&lt;br /&gt;&lt;br /&gt;From another host, I sent a large file over the network to drive the interface at capacity. I thought I'd start by showing how busy the network interface was by using the sysperfstat tool from the &lt;a href="http://www.brendangregg.com/k9toolkit.html"&gt;K9Toolkit&lt;/a&gt; (I usually use nicstat, I thought this would be a nice change). sysperfstat ran for a few seconds, then I began the bulk network transfer:&lt;br /&gt;&lt;pre&gt;$ /brendan/K9Toolkit/sysperfstat 1&lt;br /&gt;    Time    %CPU   %Mem  %Disk   %Net     CPU    Mem   Disk    Net&lt;br /&gt;19:24:27    5.24  33.52   0.52   0.07    0.05   0.00   0.01   0.00&lt;br /&gt;19:24:28    7.35  33.53   1.29   0.00    0.00   0.00   0.00   0.00&lt;br /&gt;19:24:29    7.48  33.53   0.00   0.00    0.00   0.00   0.00   0.00&lt;br /&gt;19:24:30   39.65  33.79   1.27  51.27    3.69   0.00   0.00   0.00&lt;br /&gt;19:24:32   65.67  33.79   0.00 173.14    1.28   0.00   0.00   0.00&lt;br /&gt;19:24:34   68.35  33.79   0.00 173.03    0.00   0.00   0.00   0.00&lt;br /&gt;19:24:37   80.12  33.79   0.00 176.33    0.82   0.00   0.00   0.00&lt;br /&gt;19:24:39   76.97  33.79   0.00 178.12    0.43   0.00   0.00   0.00&lt;br /&gt;19:24:41   76.08  33.79   1.61 164.82    1.37   0.00   0.00   0.00&lt;br /&gt;19:24:44   80.18  33.79   0.00 177.68    0.38   0.00   0.00   0.00 &lt;/pre&gt;&lt;br /&gt;Oh dear! I was expecting %Net to reach around 90%, not over 170%! &lt;br /&gt;&lt;br /&gt;Both the Net and Disk percentages are in terms of a single interface or disk, as from experience this has shown to be more useful than a global percentage (which CPU and Mem use). 170% could indicate that I have two network interfaces running at around 85%. But why? I had only initiated one network transfer to the hme0 address.&lt;br /&gt;&lt;br /&gt;... The system had become so heavily loaded that sysperfstat's interval of 1 second became 2 and sometimes 3 seconds. Good thing I never assumed sleep(1) would actually sleep for 1 second only - sysperfstat uses delta times from kstat measurements.&lt;br /&gt;&lt;br /&gt;Demonstrations are much more exciting when even you don't know of the outcome. So why did we hit 170% utilisation? Maybe another network interface was doing traffic that I didn't know about:&lt;br /&gt;&lt;pre&gt;# ifconfig -a&lt;br /&gt;lo0: flags=2001000849&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL&amp;gt; mtu 8232 index 1&lt;br /&gt;        inet 127.0.0.1 netmask ff000000&lt;br /&gt;hme0: flags=1000863&amp;lt;UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,IPv4&amp;gt; mtu 1500 index 2&lt;br /&gt;        inet 192.168.1.13 netmask ffffff00 broadcast 192.168.1.255&lt;br /&gt;        ether 8:0:20:b0:7a:18&lt;br /&gt;qfe0: flags=1000862&amp;lt;BROADCAST,NOTRAILERS,RUNNING,MULTICAST,IPv4&amp;gt; mtu 1500 index 3&lt;br /&gt;        inet 10.1.2.3 netmask ff000000 broadcast 10.255.255.255&lt;br /&gt;        ether 8:0:20:b0:7a:18&lt;br /&gt;#&lt;/pre&gt;&lt;br /&gt;No answers there. &lt;code&gt;hme0&lt;/code&gt; is "UP", &lt;code&gt;qfe0&lt;/code&gt; is both down and has an address class that we aren't using anywhere at this site. So qfe0 can't be doing anything, right?&lt;br /&gt;&lt;pre&gt;$ /brendan/K9Toolkit/nicstat 1&lt;br /&gt;    Time   Int   rKb/s   wKb/s   rPk/s   wPk/s    rAvs    wAvs   %Util     Sat&lt;br /&gt;19:25:34  qfe0    3.77    0.00    2.98    0.00  1292.8   42.00    0.03    0.00&lt;br /&gt;19:25:34  hme0    4.69    0.42    3.77    5.92  1272.9   72.52    0.04    0.00&lt;br /&gt;    Time   Int   rKb/s   wKb/s   rPk/s   wPk/s    rAvs    wAvs   %Util     Sat&lt;br /&gt;19:25:36  qfe0 10435.6    0.00  8642.5    0.00  1236.4    0.00   85.49    0.00&lt;br /&gt;19:25:36  hme0 10394.1   818.6  8601.4 15524.7  1237.4   54.00   91.86    0.00&lt;br /&gt;    Time   Int   rKb/s   wKb/s   rPk/s   wPk/s    rAvs    wAvs   %Util     Sat&lt;br /&gt;19:25:39  qfe0 10469.2    0.00  8744.1    0.00  1226.0    0.00   85.76    0.00&lt;br /&gt;19:25:39  hme0 10451.4   828.3  8732.5 15708.5  1225.5   54.00   92.40    0.00 &lt;/pre&gt;&lt;br /&gt;Woah - this "down" &lt;code&gt;qfe0&lt;/code&gt; with a dummy address is 85% busy - somthing really strange is going on! &lt;br /&gt;&lt;br /&gt;I had began this demo to show %CPU for busy interfaces, which leads us to run the the DTrace based "intrstat" tool - new to Solaris 10. This shows us how much CPU our network interface interrupts are consuming, and now I had a renewed interest in what it had to say:&lt;br /&gt;&lt;pre&gt;# intrstat 1&lt;br /&gt;&lt;br /&gt;      device |      cpu0 %tim&lt;br /&gt;-------------+---------------&lt;br /&gt;       hme#0 |      1232 32.8&lt;br /&gt;       m64#0 |         0  0.0&lt;br /&gt;       qfe#0 |      1140 37.8&lt;br /&gt;        su#0 |         0  0.0&lt;br /&gt;        su#1 |         0  0.0&lt;br /&gt;      uata#0 |         0  0.0&lt;br /&gt;&lt;br /&gt;      device |      cpu0 %tim&lt;br /&gt;-------------+---------------&lt;br /&gt;       hme#0 |      1233 32.9&lt;br /&gt;       m64#0 |         0  0.0&lt;br /&gt;       qfe#0 |      1138 37.8&lt;br /&gt;        su#0 |         0  0.0&lt;br /&gt;        su#1 |         0  0.0&lt;br /&gt;      uata#0 |         1  0.0&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;hme0 is consuming 33% of CPU0, quite a substantial amount - considering this is just a 100 Mbit/sec interface. That's where the planned demo would have ended.&lt;br /&gt;&lt;br /&gt;However qfe0 is consuming 37.8% of CPU0 - this is really frightening! Remember, I am sending traffic to hme0's address, and qfe0 is not marked "UP". This is a dead interface with a dummy address - and it is consuming a LOT of CPU! (perhaps it is talking to other dead interfaces? ;-)&lt;br /&gt;&lt;br /&gt;I began thinking outside the box, and &lt;a href="http://blogs.sun.com/doc"&gt;Scott&lt;/a&gt; was around to help. We found that the room was connected to a hub, both hme0 and qfe0 were connected to this same hub, and they both had the same ethernet address. So while qfe0 eventually rejected the packets that it could see, it had to walk through much kernel code to get to that point - consuming CPU cycles and incrementing kstats. (a clue from the nicstat output was that qfe0 was receiving but not sending - so it wasn't taking part in a connection).&lt;br /&gt;&lt;br /&gt;I unplugged qfe0 and the problem vanished. Easy. However associating CPU load with a down interface is far from easy!&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;As an aside, I also ask how we measure how &lt;i&gt;utilised&lt;/i&gt; the network interfaces are. Very few people have been able to answer this - and it is a topic I hope chapter 7 of this &lt;a href="http://www.sun.com/books/catalog/solaris_perf_tools.xml"&gt;book&lt;/a&gt; will increase awareness for. (eg, nicstat or sysperfstat from the &lt;a href="http://www.brendangregg.com"&gt;K9Toolkit&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115531622920974749?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115531622920974749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115531622920974749' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115531622920974749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115531622920974749'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/08/how-much-cpu-does-down-interface-chew.html' title='How much CPU does a down interface chew?'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115505712177121245</id><published>2006-08-08T10:04:00.000-07:00</published><updated>2006-08-08T10:13:18.830-07:00</updated><title type='text'>Solaris Performance and Tools</title><content type='html'>Both &lt;a href="http://www.sun.com/books/catalog/solaris_internals.xml"&gt;Solaris Internals 2nd Edition&lt;/a&gt; and &lt;a href="http://www.sun.com/books/catalog/solaris_perf_tools.xml"&gt;Solaris Performance and Tools&lt;/a&gt; are available to purchase, and copies have now began arriving around the World. They are both incredible books, covering an enormous range of topics with details not found anywhere else.&lt;br /&gt;&lt;table border=0&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt; &lt;a href="http://www.amazon.com/gp/product/0131482092" border=0&gt;&lt;br /&gt; &lt;img src="http://users.tpg.com.au/adsln4yb/Photos/Misc/0131482092_sml.jpg"&gt;&lt;br /&gt; &lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt; &lt;a href="http://www.amazon.com/gp/product/0131568191" border=0&gt;&lt;br /&gt; &lt;img src="http://users.tpg.com.au/adsln4yb/Photos/Misc/0131568191_sml.jpg"&gt;&lt;br /&gt; &lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;During my years working in the field of performance, I've taught numerous performance classes for Sun Microsystems where I gained both the experience and understanding of how to best teach performance. I have also written numerous open source programs for performance monitoring, such as tools in the &lt;a  href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt; and the &lt;a href="http://www.brendangregg.com/k9toolkit.html"&gt;K9Toolkit&lt;/a&gt;. It was a privilege to share the best of my performance knowledge and teaching experience by co-authoring Solaris Performance and Tools with &lt;a href="http://blogs.sun.com/rmc"&gt;Richard&lt;/a&gt; and &lt;a href="http://blogs.sun.com/jimmauro"&gt;Jim&lt;/a&gt;. We were fortunate to have many other subject matter experts also contribute to this book, including &lt;a href="http://blogs.sun.com/mws"&gt;Mike Shapiro&lt;/a&gt; and &lt;a href="http://blogs.sun.com/jonh"&gt;Jon Haslam&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For Solaris Performance and Tools, it is exciting to see a book that covers both DTrace and mdb in detail, with practical examples. And Solaris Internals 2nd Edition is fascinating for understanding the kernel, with the numerous Solaris 10  enhancements. I hope people enjoy them both.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115505712177121245?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115505712177121245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115505712177121245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115505712177121245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115505712177121245'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/08/solaris-performance-and-tools.html' title='Solaris Performance and Tools'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115372237209822085</id><published>2006-07-23T23:25:00.000-07:00</published><updated>2006-07-23T23:26:12.100-07:00</updated><title type='text'>Solaris Internals 2nd Edition - available!</title><content type='html'>Great news! Solaris Internals 2nd Edition is now available to purchase from sites such as &lt;a href="http://www.amazon.com/gp/product/0131482092"&gt;Amazon&lt;/a&gt;. Amazon writes "Availability: Usually ships within 24 hours" - so in less than a day (I imagine a business day, if you are in the US), you could be holding this landmark book.&lt;br /&gt;&lt;br /&gt;I've studied this edition from cover to cover, and it is incredible to see such a wide range of topics covered well, and at such a unique depth. It is &lt;i&gt;the&lt;/i&gt; reference for the Solaris 10 and OpenSolaris kernel, and is written in an endearing way that makes this enormous topic very approachable.&lt;br /&gt;&lt;br /&gt;I can't wait to get my hard copy of this book. I really enjoyed studying the content the first time, and I'll really enjoy revisiting the chapters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115372237209822085?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115372237209822085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115372237209822085' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115372237209822085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115372237209822085'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/07/solaris-internals-2nd-edition_24.html' title='Solaris Internals 2nd Edition - available!'/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115323062031747585</id><published>2006-07-18T05:50:00.000-07:00</published><updated>2006-07-18T06:54:43.670-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTrace Slides&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.context-switch.com/performance/dtrace_workshop01_slides.pdf"&gt;slides&lt;/a&gt; I used for the recent DTrace Workshop in London have been put &lt;a href="http://www.context-switch.com/performance/dtrace.htm"&gt;online&lt;/a&gt; by &lt;a href="http://www.context-switch.com"&gt;Context-Switch&lt;/a&gt;. This DTrace presentation covers my own method of teaching DTrace, which begins with a summary of performance monitoring tools in Solaris 9 and their limitations. &lt;br /&gt;&lt;br /&gt;The slides also document many of the strategies I use for DTrace analysis, and is the first time they have been listed together online. They are,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DTrace Strategies&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Snoop or Summary&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Drill Down Analysis&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Frequency Count&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Known Count&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Aggregate Stacks&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Elapsed Time&lt;/li&gt;&lt;br /&gt;&lt;li&gt;On-CPU Time&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Milestones&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;See chapters 5 and 10 from the slides for details.&lt;br /&gt;&lt;br /&gt;The slides are used in conjunction with additional live demonstrations and student labs. They also assume that the &lt;i&gt;almost&lt;/i&gt; released book, &lt;a href="http://www.solarisinternals.com"&gt;Solaris Performance and Tools&lt;/a&gt; can be used as a reference.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115323062031747585?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115323062031747585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115323062031747585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115323062031747585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115323062031747585'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/07/dtrace-slides-slides-i-used-for-recent.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-115146374133495070</id><published>2006-06-27T19:28:00.000-07:00</published><updated>2006-06-27T20:02:21.350-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Offline&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've been mostly offline for a few weeks, and this will continue for a few more. I'm in the middle of at 6 weeks of travel (London, London, Perth, Canberra, Melbourne, Tokyo, ...?), much of which is spent at hotels without Internet access or at airports (and all of it without access to my DTrace development servers at home, in Sydney).&lt;br /&gt;&lt;br /&gt;By a stroke of luck I am actually in Sydney on the 6th of July (inbetween flights), and should be at the next meeting for SOSUG.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-115146374133495070?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/115146374133495070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=115146374133495070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115146374133495070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/115146374133495070'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/06/offline-ive-been-mostly-offline-for.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114909247192680970</id><published>2006-05-31T09:12:00.001-07:00</published><updated>2006-05-31T09:41:11.650-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTraceTazTool - alpha release&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Several years ago, &lt;a href="http://blogs.sun.com/roller/page/rmc"&gt;Richard McDougall&lt;/a&gt; wrote &lt;a href="http://www.solarisinternals.com/si/tools/taz/index.php"&gt;taztool&lt;/a&gt;  - a GUI to display disk activity in an amazing and intuitive way. It used TNF trace data - a predecessor of &lt;a href="http://www.opensolaris.org/os/community/dtrace"&gt;DTrace&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.brendangregg.com/dtrace.html#DTraceTazTool"&gt;website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;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).&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/DTaz/dtaz07.PNG" border=0&gt;&lt;br /&gt;&lt;br /&gt;DTraceTazTool already has some tunable options, such as the size of the pixels drawn and the sample rate,&lt;br /&gt;&lt;br /&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/DTaz/dtaz06.PNG" border=0&gt;&lt;br /&gt;&lt;br /&gt;DTraceTazTool needs to either run as root, or as a user with the dtrace_kernel privilege.&lt;br /&gt;&lt;br /&gt;I hope you enjoy the tool so far. I'll post about updates as I complete them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114909247192680970?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114909247192680970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114909247192680970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114909247192680970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114909247192680970'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/06/dtracetaztool-alpha-release-several.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114883723702015555</id><published>2006-05-28T10:14:00.000-07:00</published><updated>2006-05-28T10:27:17.050-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Book Updates&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Jim did post an &lt;a href="http://blogs.sun.com/roller/page/jimmauro?entry=a_tale_of_two_books"&gt;entry&lt;/a&gt; about Solaris Internals 2nd edition and Sun Performance and Tuning. We are all now eagerly awaiting the publication of these books.&lt;br /&gt;&lt;br /&gt;An article about these books was posted on &lt;a href="http://sunflash.sun.com/articles/99/3"&gt;sunflash.sun.com&lt;/a&gt; (login required), a website of Sun events.&lt;br /&gt;&lt;br /&gt;And some updates were made to the Prentice Hall website for these books (&lt;a href="http://vig.prenhall.com/catalog/academic/product/0,1144,0131482092,00.html"&gt;Solaris Internals 2nd edition&lt;/a&gt;, &lt;a href="http://vig.prenhall.com/catalog/academic/product/0,1144,0131568191,00.html"&gt;Sun Performance and Tools&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114883723702015555?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114883723702015555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114883723702015555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114883723702015555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114883723702015555'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/05/book-updates-jim-did-post-entry-about.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114883164641668715</id><published>2006-05-28T08:29:00.000-07:00</published><updated>2006-05-28T08:54:06.430-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTracing Scheduling Classes&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've recently been working on some new killer DTrace scripts, and the DTrace &lt;a href="http://www.context-switch.com/performance/dtrace.htm"&gt;UK Workshops&lt;/a&gt;. I thought I'd take a break and share something interesting.&lt;br /&gt;&lt;br /&gt;The following is from the &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt;,  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.&lt;br /&gt;&lt;br /&gt;&lt;hr width=100&gt;&lt;br /&gt;The following is a demonstration of the &lt;b&gt;priclass.d&lt;/b&gt; script.&lt;br /&gt;&lt;br /&gt;The script was run for several seconds then Ctrl-C was hit. During this time, other processes in different scheduling classes were running.&lt;br /&gt;&lt;pre&gt;# ./priclass.d&lt;br /&gt;Sampling... Hit Ctrl-C to end.&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;  IA&lt;br /&gt;           value  ------------- Distribution ------------- count&lt;br /&gt;              40 |                                         0&lt;br /&gt;              50 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 30&lt;br /&gt;              60 |                                         0&lt;br /&gt;&lt;br /&gt;  SYS&lt;br /&gt;           value  ------------- Distribution ------------- count&lt;br /&gt;             &lt; 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  4959&lt;br /&gt;               0 |                                         0&lt;br /&gt;              10 |                                         0&lt;br /&gt;              20 |                                         0&lt;br /&gt;              30 |                                         0&lt;br /&gt;              40 |                                         0&lt;br /&gt;              50 |                                         0&lt;br /&gt;              60 |                                         30&lt;br /&gt;              70 |                                         0&lt;br /&gt;              80 |                                         0&lt;br /&gt;              90 |                                         0&lt;br /&gt;             100 |                                         0&lt;br /&gt;             110 |                                         0&lt;br /&gt;             120 |                                         0&lt;br /&gt;             130 |                                         0&lt;br /&gt;             140 |                                         0&lt;br /&gt;             150 |                                         0&lt;br /&gt;             160 |                                         50&lt;br /&gt;          &gt;= 170 |                                         0&lt;br /&gt;&lt;br /&gt;  RT&lt;br /&gt;           value  ------------- Distribution ------------- count&lt;br /&gt;              90 |                                         0&lt;br /&gt;             100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 110&lt;br /&gt;             110 |                                         0&lt;br /&gt;&lt;br /&gt;  TS&lt;br /&gt;           value  ------------- Distribution ------------- count&lt;br /&gt;             &lt; 0 |                                         0&lt;br /&gt;               0 |@@@@@@@@@@@@@@@                          2880&lt;br /&gt;              10 |@@@@@@@                                  1280&lt;br /&gt;              20 |@@@@@                                    990&lt;br /&gt;              30 |@@@@@                                    920&lt;br /&gt;              40 |@@@@                                     670&lt;br /&gt;              50 |@@@@                                     730&lt;br /&gt;              60 |                                         0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The output is quite interesting, and illustrates neatly the behaviour of different scheduling classes.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;The SYS system class has had 4959 samples at a &lt; 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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114883164641668715?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114883164641668715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114883164641668715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114883164641668715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114883164641668715'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/05/dtracing-scheduling-classes-ive.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114715528277873157</id><published>2006-05-08T22:11:00.000-07:00</published><updated>2006-05-10T08:04:27.693-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Ged - GUI-ed&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've just uploaded &lt;a href="http://www.brendangregg.com/specials.html#ged"&gt;Ged&lt;/a&gt; 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 &lt;a href="http://www.povray.org"&gt;POV-ray&lt;/a&gt;.[1]&lt;br /&gt;&lt;br /&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Specials/ged01.png"&gt;&lt;br /&gt;&lt;br /&gt;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 (&lt;a href="http://www.opensolaris.org/os/community/dtrace"&gt;DTrace&lt;/a&gt;) and &lt;a href="http://www.opensolaris.org/os/community/games"&gt;Games&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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!&lt;br /&gt;&lt;br /&gt;[1] which was then mutilated by downsampling to "classic" 2-bit colour.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114715528277873157?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114715528277873157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114715528277873157' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114715528277873157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114715528277873157'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/05/ged-gui-ed-ive-just-uploaded-ged-to.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114598364823776689</id><published>2006-04-25T09:39:00.000-07:00</published><updated>2006-04-25T09:47:31.430-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Learn DTrace @ London&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;During the past five years I've delivered many training events across Australia and Asia; however this will be my first event in Europe.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.context-switch.com/performance/dtrace.htm"&gt;here&lt;/a&gt;, and seats are currently available (but won't be forever).&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;There are currently no plans to run these classes again, so as far as I know - this is it.&lt;br /&gt;&lt;br /&gt;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!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114598364823776689?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114598364823776689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114598364823776689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114598364823776689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114598364823776689'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/04/learn-dtrace-london-during-past-five.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114598067300253980</id><published>2006-04-25T08:05:00.000-07:00</published><updated>2006-04-25T08:57:53.036-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTraceToolkit ver 0.96&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've just uploaded the latest build of &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt;, which now contains 104 scripts!&lt;br /&gt;&lt;br /&gt;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).&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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!).&lt;br /&gt;&lt;br /&gt;As usual, check locations such as Docs/Examples for examples of the newly added scripts in action. Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114598067300253980?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114598067300253980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114598067300253980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114598067300253980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114598067300253980'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/04/dtracetoolkit-ver-0.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114545528656810740</id><published>2006-04-19T05:36:00.000-07:00</published><updated>2006-04-19T07:01:26.620-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Tokyo, Japan&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.brendangregg.com/Photos/Tokyo/"&gt;photos&lt;/a&gt;. I've just added a series of them to the cityscapes on my website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114545528656810740?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114545528656810740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114545528656810740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114545528656810740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114545528656810740'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/04/tokyo-japan-few-weeks-ago-i-was-in.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-114421415044606470</id><published>2006-04-04T20:25:00.000-07:00</published><updated>2006-04-04T22:15:50.463-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Solaris Internals 2nd Edition&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This book (now 2 volumes) has been sent to the publisher! &lt;br /&gt;&lt;br /&gt;Jim and Richard have again made a remarkable effort to create a unique and valuable reference. It covers an incredible range of topics, each with useful explinations you won't find anywhere else. &lt;br /&gt;&lt;br /&gt;Richard has posted an entry to &lt;a href="http://blogs.sun.com/roller/page/rmc?entry=performance_observability_dtrace_and_mdb"&gt;describe the books&lt;/a&gt;, and links to their tables of contents.&lt;br /&gt;&lt;br /&gt;I'm very proud to have helped out, including authoring material for the 2nd volume. For many years I've taught Solaris performance classes for Sun, engaged in Solaris performance consulting, and more recently written freeware performance tools - such as the DTraceToolkit. It's been a privilege to share my most useful knowledge in this way.&lt;br /&gt;&lt;br /&gt;I have provided scripts inline (listing the source) wherever possible - giving the reader the choice of either using the script, or reading and understanding the script internals - and making their own customisations. We do often discuss such tool internals - which is appropriate for Solaris Internals.&lt;br /&gt;&lt;br /&gt;I've also carefully studied both volumes in detail - and it is truly incredible what they cover. This will open the lid on many new topics that have previously not been discussed or exposed. Other engineers and experts have helped out, providing many valuable insights - especially when discussing technology that they themselves created.&lt;br /&gt;&lt;br /&gt;I think this has a wider audience than the first edition as we discuss topics closer to home for sysadmins, support staff and developers - such as performance observability and debugging. Check the table of contents for the second volume to see what I mean.&lt;br /&gt;&lt;br /&gt;It's now up to the publisher to print out the book. If there is any news on this we can share, we will. Check our blogs (&lt;a href="http://blogs.sun.com/rmc"&gt;Richard&lt;/a&gt;, &lt;a href="http://blogs.sun.com/jimmauro"&gt;Jim&lt;/a&gt;, and me).&lt;br /&gt;&lt;br /&gt;I've been somewhat quiet on the OpenSolaris scene during the last several weeks - this is why! I'm now "back" :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-114421415044606470?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/114421415044606470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=114421415044606470' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114421415044606470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/114421415044606470'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/04/solaris-internals-2nd-edition-this.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113987823941551813</id><published>2006-02-13T16:24:00.000-08:00</published><updated>2006-02-13T16:50:39.426-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Learn DTrace, visit Sydney&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Sun is borrowing me to deliver a 3-day &lt;a href="http://au.sun.com/training/catalog/courses/SA-327-S10.xml"&gt;DTrace class&lt;/a&gt; in Sydney, starting on the 6th of March (assuming enough students sign up). I love DTrace, and teaching it on behalf of Sun is a great privilege.&lt;br /&gt;&lt;br /&gt;Occasionally, Australian IT workers will be lucky enough to visit the US (or elsewhere) to attend unique training classes. Classes that aren't taught anywhere else in the World. While it's no holiday (it can be hard work), it does make for a fantastic break from sitting behind a desk day after day (or sitting in a cold server room).&lt;br /&gt;&lt;br /&gt;Please let me return the favour and give you an excuse to visit Sydney, Australia! Where else in the World will you be taught DTrace from the author of the &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;I have taught DTrace before: be prepared for some really intense training! We usually drink lots of coffee, finish later than usual, and cover a lot more than is in the notes. I encourage students to bring in their work problems and get me to solve them (live, in front of the class!).&lt;br /&gt;&lt;br /&gt;Ok, I know many companies may choke at the thought of paying for flights to Australia + hotel + training. But if you do wangle it, then I'll see you on the 6th (and the weather is usually great that time of year. ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113987823941551813?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113987823941551813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113987823941551813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113987823941551813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113987823941551813'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/02/learn-dtrace-visit-sydney-sun-is.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113937065204159501</id><published>2006-02-07T19:22:00.000-08:00</published><updated>2006-02-07T19:50:52.060-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;OpenSolaris Games&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The OpenSolaris &lt;a href="http://www.opensolaris.org/os/community/games/"&gt;Games&lt;/a&gt; community has opened. It exists to list games, provide install instructions, develop new games, and to give us an excuse to play games.&lt;br /&gt;&lt;br /&gt;There are tons of games out there that will work on OpenSolaris. These include RougeLike games, such as NetHack, Angband, ZAngband, ToME, etc, and ports of the Doom engine. I've linked to a modest collection on the website, which will gradually grow as others help out.&lt;br /&gt;&lt;br /&gt;Please post game URLs to the &lt;a href="http://www.opensolaris.org/os/community/games/discussions/"&gt;mailing list&lt;/a&gt;, and help out where you can. There are many games and many genres, and to cover them properly on a website will need a lot of help from the OpenSolaris community.&lt;br /&gt;&lt;br /&gt;So far, most of the games are hosted on &lt;a href="http://www.blastwave.org"&gt;Blastwave&lt;/a&gt; - thanks to Dennis and team for making them available.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;I have actually written games in the past, although they wern't very good games. These include &lt;a href="http://www.brendangregg.com/DtkshDemos/xpong"&gt;xpong&lt;/a&gt; written entirerly in dtksh, and a &lt;a href="http://www.brendangregg.com/Specials/wumpus.c"&gt;port&lt;/a&gt; of "Hunt the Wumpus" as an mdb loadable module. I'm also helping with other projects to write decent games, including a curses based shoot-em-up written by &lt;a href="http://www.users.on.net/~boyd.adamson/"&gt;Boyd&lt;/a&gt;; more on that later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113937065204159501?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113937065204159501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113937065204159501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113937065204159501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113937065204159501'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/02/opensolaris-games-opensolaris-games.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113836272102242734</id><published>2006-01-27T02:55:00.000-08:00</published><updated>2006-01-27T03:52:02.790-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;checkcable 0.95&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.brendangregg.com/Solaris/checkcable"&gt;checkcable&lt;/a&gt; has been updated. It now uses the Perl library Sun::Solaris::Kstat again, where possible. The first version did this for all cards, but the Kstat data wasn't reliable and sadly I had to wrap ndd instead (boring!). &lt;br /&gt;&lt;br /&gt;If you haven't seen it before, checkcable produces the following output,&lt;br /&gt;&lt;pre&gt;   # checkcable&lt;br /&gt;   Interface   Link Duplex  Speed  AutoNEG&lt;br /&gt;   hme0          UP   FULL    100       ON&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It has been written to support dmfe, bge, ce, rtls, ge, hme, and a few others. It occasionally gets updated to support extra cards (see the HISTORY list). Many people have emailed me about this program over the years - thanks for your support. If you do send me updates to the code, please follow the style. These days I'm following "Perl Best Practices" by O'Reilly (yes Mark, you've guilted me into it :-). &lt;br /&gt;&lt;br /&gt;In similar news, &lt;a href="http://blogs.sun.com/tpenta"&gt;Alan&lt;/a&gt; has been working on bringing Kstat.pm into the OpenSolaris build, which all of my Sun::Solaris::Kstat tools use. Thank you Alan!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113836272102242734?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113836272102242734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113836272102242734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113836272102242734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113836272102242734'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/01/checkcable-0.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113699553720927084</id><published>2006-01-11T07:59:00.000-08:00</published><updated>2006-01-11T08:07:00.003-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Brendan Clones&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Recently James Dickens figured out that I'm a member of a family of Brendan clones, and &lt;a href="http://uadmin.blogspot.com/2005/12/sun-performance-metrics.html"&gt;suggested&lt;/a&gt; that there may be 1000 Brendan clones in Australia. Now that the cat's out of the bag, let me clear up a few things and introduce the gang. Firstly, there isn't 1000 of us - it's more like a dozen, however the number does vary. The following is a photo of 7 Brendan clones busy working.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.brendangregg.com/Photos/Misc/brendan_clones01.jpg"&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Photos/Misc/sml_brendan_clones01.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sitting on the close left is documentation Brendan, and on the far left is testing Brendan - who is always busy testing programs in a variety of scenarios. Documentation Brendan takes the most interesting tests from testing Brendan and turns them into example documentation. Documentation Brendan also sometimes answers emails when email Brendan is travelling for work (as is the case here).&lt;br /&gt;&lt;br /&gt;On the close right is programmer Brendan hard at work typing code. Sitting on the far right is creative Brendan, making suggestions to programmer Brendan. Creative Brendan maintains the enormous todo list for all the Brendan clones.&lt;br /&gt;&lt;br /&gt;Sitting under the desk reading is study Brendan, who is currently studying "Solaris Systems Programming" by Rich Teer. Study Brendan is always reading, and reads textbooks from cover to cover. If he isn't careful he may need to get glasses (or borrow them from engineer Brendan, who isn't pictured here).&lt;br /&gt;&lt;br /&gt;Sleeping on the floor is sleeping Brendan, who sleeps on behalf of all the Brendan clones.&lt;br /&gt;&lt;br /&gt;Standing with the cricket bat is master Brendan, who creates Brendan clones and destroys the ones not working hard enough. Programmer Brendan calls him "homicidal maniac Brendan", and only gets away with it as he works so hard.&lt;br /&gt;&lt;br /&gt;Out of shot is TV Brendan, watching the Australia vs South Africa test cricket series. And (of course) photographer Brendan is taking the photo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113699553720927084?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113699553720927084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113699553720927084' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113699553720927084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113699553720927084'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/01/brendan-clones-recently-james-dickens.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113699278821710859</id><published>2006-01-11T07:11:00.000-08:00</published><updated>2006-01-11T07:19:48.246-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTraceToolkit ver 0.92&lt;/b&gt;&lt;br /&gt;I've just uploaded the latest version of the DTraceToolkit. A number of niggling issues have been fixed, and a few scripts added. &lt;br /&gt;&lt;br /&gt;The next few releases should be about polishing other components of the toolkit - such as documentation and examples, rather than simply adding more scripts.&lt;br /&gt;&lt;br /&gt;I hope you find the toolkit useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113699278821710859?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113699278821710859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113699278821710859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113699278821710859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113699278821710859'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/01/dtracetoolkit-ver-0.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113688972191647546</id><published>2006-01-10T01:51:00.000-08:00</published><updated>2006-01-10T02:42:02.110-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;findbill&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I just made a quick update to &lt;a href="http://www.brendangregg.com/Solaris/findbill"&gt;findbill&lt;/a&gt;, a simple Perl program that scans a disk to find where backup UFS superblocks are. Most of the time sysadmins use "newfs -N" for this - however if you have tuned file system parameters "newfs -N" doesn't always work.&lt;br /&gt;&lt;br /&gt;The output now includes information from the superblocks: last write time and mountpoint, if available. This should help identify what are false positives - such as older superblocks from a previous filesystem that haven't been overwritten.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# findbill /dev/rdsk/c0d0s3&lt;br /&gt;Searching /dev/rdsk/c0d0s3,&lt;br /&gt;&lt;br /&gt;Type     Block    Time last written         Mountpoint&lt;br /&gt;UFS      16       Sun Jan  8 16:11:42 2006  /extra1&lt;br /&gt;UFS      32       Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      32352    Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      64672    Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      96992    Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      129312   Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      161632   Sun Apr 17 18:28:54 2005&lt;br /&gt;UFS      193952   Sun Apr 17 18:28:54 2005&lt;br /&gt;^C&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's called "findbill" as I've heard the UFS magic number (0x011954, which we scan for) is either Bill Joy's or Marshall Kirk McKusick's birthday (the FFS authors). The UFS cylinder block magic number (0x090255) looks suspicious too.&lt;br /&gt;&lt;br /&gt;findbill also identifies superblocks from MTB_UFS - the revamped UFS for the world of terabyte filesystems (UFS lives!).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113688972191647546?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113688972191647546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113688972191647546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113688972191647546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113688972191647546'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/01/findbill-i-just-made-quick-update-to.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113644459834303995</id><published>2006-01-04T22:29:00.000-08:00</published><updated>2006-01-04T23:06:55.783-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;3d Photos&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've uploaded new photos to my website, including some of &lt;a href="http://www.brendangregg.com/Photos/SanFrancisco/index.html"&gt;San Francisco&lt;/a&gt; and the &lt;a href="http://www.brendangregg.com/Photos/GrandCanyon/index.html"&gt;Grand Canyon&lt;/a&gt;. I've also uploaded a few 3d anaglyphs (red/cyan glasses) taken at &lt;a href="http://www.brendangregg.com/Photos/3d_Beijing/index.html"&gt;Beijing&lt;/a&gt;,&lt;table border=1&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&lt;a href="http://bdgphotos.primenotprime.net/3d_Beijing/3d_beijing01.jpg"&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Photos/3d_Beijing/tn_3d_beijing01.jpg" border=0&gt;&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;center&gt;&lt;a href="http://bdgphotos.primenotprime.net/3d_Beijing/3d_beijing02.jpg"&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Photos/3d_Beijin/tn_3d_beijing02.jpg" border=0&gt;&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;&lt;center&gt;&lt;a href="http://bdgphotos.primenotprime.net/3d_Beijing/3d_beijing03.jpg"&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Photos/3d_Beijin/tn_3d_beijing03.jpg" border=0&gt;&lt;/a&gt;&lt;/center&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;I created these anaglyphs using the freeware tool &lt;a href="http://anabuilder.free.fr/indexEN.html"&gt;AnaBuilder&lt;/a&gt;, and are available in full resolution (downsampling anaglyphs can sometimes cause odd JPEG artifacts). Anaglyphs may give way to autostereo displays in the future (no glasses required), or even VR displays if they ever take of, so keep hold of the original left/right pair. In the meantime anaglyphs are fine.&lt;br /&gt;&lt;br /&gt;Hopefully I'll inspire others to try 3d photography. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113644459834303995?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113644459834303995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113644459834303995' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113644459834303995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113644459834303995'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2006/01/3d-photos-ive-uploaded-new-photos-to.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113428379088131435</id><published>2005-12-10T22:30:00.000-08:00</published><updated>2005-12-10T22:51:20.103-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Solaris Performance Metrics&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've uploaded the first paper in a series I'm writing on Solaris performance monitoring metrics, it covers "disk utilisation by process" (AKA "utilization"). I've also created a &lt;a href="http://www.brendangregg.com/Perf/solarismetrics.html"&gt;website&lt;/a&gt; where the paper can be downloaded, and a cover photo, &lt;br /&gt;&lt;br /&gt;&lt;img src="http://users.tpg.com.au/adsln4yb/Perf/car09s.jpg"&gt;&lt;br /&gt;&lt;br /&gt;... Which readers of Sun Performance and Tuning may find familiar. :-)&lt;br /&gt;&lt;br /&gt;While writing freeware such as the DTraceToolkit, I'm often asked to explain the performance metrics I've choosen in greater detail. These papers will serve as a reference that I can point people to.&lt;br /&gt;&lt;br /&gt;I began writing these over a year ago, &lt;i&gt;before&lt;/i&gt; I had access to the kernel code. I liked to believe that it wasn't such a problem, yet with hindsight it was. The OpenSolaris project and being able to read through kernel code, has really made writing these documents &lt;i&gt;possible&lt;/i&gt;!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113428379088131435?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113428379088131435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113428379088131435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113428379088131435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113428379088131435'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/12/solaris-performance-metrics-ive.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113370523507501689</id><published>2005-12-04T05:57:00.000-08:00</published><updated>2005-12-04T06:08:18.256-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Advanced DTrace Video&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To see Bryan Cantrill speak about various advanced DTrace topics, see the recent SOSUG (Sydney OpenSolaris User Group) &lt;a href="http://blogs.sun.com/roller/page/tpenta?entry=sosug_4_videos_available"&gt;videos&lt;/a&gt; that &lt;a href="http://blogs.sun.com/tpenta"&gt;Alan&lt;/a&gt; organised to have put online. You'll also find a ZFS presentation by &lt;a href="http://blogs.sun.com/jmcp"&gt;James&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In other news, I just uploaded the DTraceToolkit version 0.89, which has had a few changes to the way TCP is measured.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113370523507501689?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113370523507501689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113370523507501689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113370523507501689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113370523507501689'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/12/advanced-dtrace-video-to-see-bryan.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113337355268399775</id><published>2005-11-30T09:49:00.000-08:00</published><updated>2005-12-04T05:56:54.986-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTraceToolkit 0.88&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've just uploaded the &lt;a href="http://www.brendangregg.com/DTraceToolkit-latest.tar.gz"&gt;latest version&lt;/a&gt; of the DTraceToolkit, version 0.88 (88 scripts). I've updated the &lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;OpenSolaris DTraceToolkit&lt;/a&gt; site to point to the new version. This version has many updated scripts and a few new ones.&lt;br /&gt;&lt;br /&gt;Between 0.80 and 1.00 I'll be doing more work revisiting code and retesting code rather than adding scripts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113337355268399775?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113337355268399775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113337355268399775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113337355268399775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113337355268399775'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/12/dtracetoolkit-0.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113337295493261740</id><published>2005-11-30T09:38:00.000-08:00</published><updated>2005-11-30T09:49:14.953-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Homepage&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let me explain what is going on with my homepage URL for future reference.&lt;br /&gt;&lt;br /&gt;My homepage is at &lt;a href="http://www.brendangregg.com"&gt;http://www.brendangregg.com&lt;/a&gt;. It's a DNS pointer that points to wherever my homepage actually lives, which may well change - however my name will not! &lt;br /&gt;&lt;br /&gt;And yes, it is likely that my actual homepage may move at some point. Some people have experienced DNS problems with the current location (users.tpg.com.au), and I've just uploaded a new DTraceToolkit and have almost run out of space!,&lt;br /&gt;&lt;pre&gt;1070 files used (10%) - authorized: 10000 files&lt;br /&gt;30688 Kbytes used (99%) - authorized: 30720 Kb&lt;/pre&gt;&lt;br /&gt;If you've linked to www.brendangregg.com, then no problem - it will always point to the right place (which is why I have the thing - I have been through a painful website move in the past).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113337295493261740?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113337295493261740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113337295493261740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113337295493261740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113337295493261740'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/12/homepage-let-me-explain-what-is-going.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113333847219207370</id><published>2005-11-29T23:52:00.000-08:00</published><updated>2005-11-30T00:14:32.203-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Sys Admin Magazine&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The December, 2005 copy contains an article on the DTraceToolkit written by Ryan Matteson. Grab a copy! The article is "Observing I/O Behavior with the DTraceToolkit", and is quite good. It was also selected as the feature article - which means it will be available online for some time,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.samag.com/documents/sam0512a/"&gt;http://www.samag.com/documents/sam0512a/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks Matty, and Sys Admin Magazine!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113333847219207370?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113333847219207370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113333847219207370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113333847219207370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113333847219207370'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/11/sys-admin-magazine-december-2005-copy.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113285440652145422</id><published>2005-11-24T09:25:00.000-08:00</published><updated>2005-11-24T09:46:46.536-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTrace Translators&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;While teaching a DTrace class in Sydney, I've been asked about translators. They are quite useful, so I've prepared the following as a quick demo.&lt;br /&gt;&lt;br /&gt;This is a DTrace program to trace the time() syscall, print the process, it's parent, it's grand-parent, and so on.&lt;br /&gt;&lt;pre&gt;#!/usr/sbin/dtrace -s&lt;br /&gt;&lt;br /&gt;/* Declare Translator */&lt;br /&gt;&lt;br /&gt;typedef struct ancestory {&lt;br /&gt;        string me;              /* my cmd */&lt;br /&gt;        string p;               /* parent cmd */&lt;br /&gt;        string gp;              /* grand-parent cmd */&lt;br /&gt;        string ggp;             /* great-grand-parent cmd */&lt;br /&gt;        string gggp;            /* great-great-grand-parent cmd */&lt;br /&gt;} ancestory_t;&lt;br /&gt;&lt;br /&gt;translator ancestory_t &amp;lt; struct _kthread *T &amp;gt; {&lt;br /&gt;&lt;br /&gt;        /* fetch my details */&lt;br /&gt;        me = T-&gt;t_procp-&gt;p_user.u_comm;&lt;br /&gt;&lt;br /&gt;        /* fetch anscestor details if they exist */&lt;br /&gt;        p = T-&gt;t_procp-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_user.u_comm :&lt;br /&gt;            "&amp;lt;none&amp;gt;";&lt;br /&gt;        gp = T-&gt;t_procp-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_user.u_comm :&lt;br /&gt;            "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;";&lt;br /&gt;        ggp = T-&gt;t_procp-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_parent-&gt;p_user.u_comm :&lt;br /&gt;            "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;";&lt;br /&gt;        gggp = T-&gt;t_procp-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_parent-&gt;p_parent != NULL ?&lt;br /&gt;            T-&gt;t_procp-&gt;p_parent-&gt;p_parent-&gt;p_parent-&gt;p_parent-&gt;p_user.u_comm :&lt;br /&gt;            "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;" : "&amp;lt;none&amp;gt;";&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;inline ancestory_t *ancestors = xlate &amp;lt;ancestory_t *&amp;gt; (curthread);&lt;br /&gt;&lt;br /&gt;/* Main Program */&lt;br /&gt;&lt;br /&gt;syscall::gtime:entry&lt;br /&gt;{&lt;br /&gt;        printf("%s, %s, %s, %s, %s", ancestors-&gt;me,&lt;br /&gt;            ancestors-&gt;p, ancestors-&gt;gp, ancestors-&gt;ggp, ancestors-&gt;gggp);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;The main program at the end is quite consise, it prints the details from "ancestors". The translator has walked the p_parent pointers carefully, returning "&amp;lt;none&amp;gt;" if the pointer is NULL. ("ancestors-&gt;me" is unnecessary since we have "execname", I've included it as a simple demonstration).&lt;br /&gt;&lt;br /&gt;The output is,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# ./transdemo.d&lt;br /&gt;dtrace: script './transdemo.d' matched 1 probe&lt;br /&gt;CPU     ID                    FUNCTION:NAME&lt;br /&gt;  0   6615                      gtime:entry bash, sh, bash, sshd, sshd&lt;br /&gt;  0   6615                      gtime:entry date, bash, sh, bash, sshd&lt;br /&gt;  0   6615                      gtime:entry bash, sh, bash, sshd, sshd&lt;br /&gt;  0   6615                      gtime:entry nscd, init, sched, &amp;lt;none&amp;gt;, &amp;lt;none&amp;gt;&lt;br /&gt;  0   6615                      gtime:entry nscd, init, sched, &amp;lt;none&amp;gt;, &amp;lt;none&amp;gt;&lt;br /&gt;  0   6615                      gtime:entry nscd, init, sched, &amp;lt;none&amp;gt;, &amp;lt;none&amp;gt;&lt;br /&gt;  0   6615                      gtime:entry nscd, init, sched, &amp;lt;none&amp;gt;, &amp;lt;none&amp;gt;&lt;br /&gt;[...]&lt;/pre&gt;&lt;br /&gt;Without our careful pointer tests, the NULL parent pointers would have caused DTrace to print errors rather than our "&amp;lt;none&amp;gt;" keywords.&lt;br /&gt;&lt;br /&gt;The "Declare Translator" section can be cut-n-pasted into a new .d file in /usr/lib/dtrace (eg, /usr/lib/dtrace/anscestors.d) where it will be automatically imported by every future DTrace script. &lt;br /&gt;&lt;br /&gt;Take a look under /usr/lib/dtrace at the existing translator scripts, they are quite fascinating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113285440652145422?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113285440652145422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113285440652145422' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113285440652145422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113285440652145422'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/11/dtrace-translators-while-teaching.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-113247104955797165</id><published>2005-11-19T19:55:00.000-08:00</published><updated>2005-11-19T23:20:23.903-08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;ZFS&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The doors have been flung open for ZFS, Sun's "last word in filsystems". It's now in &lt;a href="http://www.opensolaris.org"&gt;OpenSolaris&lt;/a&gt; and there is a &lt;a href="http://www.opensolaris.org/os/community/zfs"&gt;ZFS Community&lt;/a&gt; page where you can find introductions, demonstrations, and advanced discussions. We don't know when ZFS will appear in Solaris 10, but for it to appear in OpenSolaris shows that the process has began.&lt;br /&gt;&lt;br /&gt;ZFS raises the bar for filesystems to a new height, and even changes the way you &lt;i&gt;think&lt;/i&gt; about filesystems. Let me provide a quick demo, although I don't have an array of spare disks handy - you'll need to pretend that each of these 1 Gb slices is actually a seperate disk,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# zpool create apps mirror c0t1d0s0 c0t1d0s1 mirror c0t1d0s3 c0t1d0s4&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's it - &lt;b&gt;1 command&lt;/b&gt; for a ZFS pool, that is both mirrored and dynamically striped (think RAID 1+0), 256 bit checksum'd, remounted on boot, and can be grown to a virtually unlimited size.&lt;br /&gt;&lt;br /&gt;Lets run a few status commands to check it worked.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# zpool list&lt;br /&gt;NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT&lt;br /&gt;apps                   1.98G   33.0K   1.98G     0%  ONLINE     -&lt;br /&gt;#&lt;br /&gt;# zpool status&lt;br /&gt;  pool: apps&lt;br /&gt; state: ONLINE&lt;br /&gt; scrub: none requested&lt;br /&gt;config:&lt;br /&gt;&lt;br /&gt;        NAME          STATE     READ WRITE CKSUM&lt;br /&gt;        apps          ONLINE       0     0     0&lt;br /&gt;          mirror      ONLINE       0     0     0&lt;br /&gt;            c0t1d0s0  ONLINE       0     0     0&lt;br /&gt;            c0t1d0s1  ONLINE       0     0     0&lt;br /&gt;          mirror      ONLINE       0     0     0&lt;br /&gt;            c0t1d0s3  ONLINE       0     0     0&lt;br /&gt;            c0t1d0s4  ONLINE       0     0     0&lt;br /&gt;#&lt;br /&gt;# df -h -F zfs&lt;br /&gt;Filesystem             size   used  avail capacity  Mounted on&lt;br /&gt;apps                   2.0G     8K   2.0G     1%    /apps&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The size of 2 Gb is correct, and the "zpool status" command neatly prints the layout.&lt;br /&gt;&lt;br /&gt;Now perhaps a slightly more realistic demo (although still no seperate disks, sorry). Rather than having all the disks combine to one filesystem, ZFS is really intended to combine disks into pools, and then have multiple filesystems share a pool. The following quick demo shows this,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# zpool create fast mirror c0t1d0s0 c0t1d0s1 mirror c0t1d0s3 c0t1d0s4&lt;br /&gt;# zfs create fast/apps&lt;br /&gt;# zfs create fast/oracle&lt;br /&gt;# zfs create fast/home&lt;br /&gt;# zfs set mountpoint=/export/home fast/home&lt;br /&gt;# zfs set compression=on fast/home&lt;br /&gt;# zfs set quota=500m fast/home&lt;br /&gt;# zfs list&lt;br /&gt;NAME                   USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;fast                  91.0K  1.97G   9.5K  /fast&lt;br /&gt;fast/apps                8K  1.97G     8K  /fast/apps&lt;br /&gt;fast/home                8K   500M     8K  /export/home&lt;br /&gt;fast/oracle              8K  1.97G     8K  /fast/oracle&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Each filesystem may have different options set, such as quotas, reservations and compression. If a filesystem was running out of space, quotas can be changed live with a single command. If the pool was running out of space, disks can be added live with a single command. &lt;br /&gt;&lt;br /&gt;As a programmer there are times when you encounter something that is so elegant and obvious that you are struck with a feeling that it is &lt;i&gt;right&lt;/i&gt;. For a moment you can clearly see what the developer was thinking and that they achieved it perfectly. ZFS is one of those moments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-113247104955797165?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/113247104955797165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=113247104955797165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113247104955797165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/113247104955797165'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/11/zfs-doors-have-been-flung-open-for-zfs.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-112883188540322211</id><published>2005-10-08T21:16:00.000-07:00</published><updated>2005-10-08T21:24:45.406-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Network Monitoring&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The network often gets blamed for performance issues in Solaris. How busy are your network interfaces? How do you find out?&lt;br /&gt;&lt;br /&gt;Many sysadmins are using "netstat -i" and looking at packet counts. Packet counts turn out to be not as useful as they seem - you don't know if they are big packets or small packets, so you really don't how utilised the network interface is.&lt;br /&gt;&lt;br /&gt;I've written an website on &lt;a href="http://www.brendangregg.com/Perf/network.html"&gt;network monitoring&lt;/a&gt;, to cover how to discover what is really happening on your network. To do this I use a variety to tools, including some based on Kstat and DTrace.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-112883188540322211?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/112883188540322211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=112883188540322211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112883188540322211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112883188540322211'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/10/network-monitoring-network-often-gets.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-112772196720592876</id><published>2005-09-26T00:52:00.000-07:00</published><updated>2005-09-26T01:07:40.330-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;mdb ::wumpus&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've added another program to the "&lt;a href="http://www.brendangregg.com/specials.html"&gt;specials&lt;/a&gt;"  page - a site of, erm, quite &lt;i&gt;special&lt;/i&gt; software indeed.&lt;br /&gt;&lt;br /&gt;It's a loadable module for the Solaris Modular Debugger command. It provides a new dmcd "::wumpus". A screenshot should say all,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# mdb&lt;br /&gt;&gt; ::load wumpus&lt;br /&gt;&gt; ::wumpus&lt;br /&gt;INSTRUCTIONS (Y-N)&lt;br /&gt;?N&lt;br /&gt;HUNT THE WUMPUS&lt;br /&gt;&lt;br /&gt;I SMELL A WUMPUS!&lt;br /&gt;BATS NEARBY!&lt;br /&gt;YOU ARE IN ROOM 17&lt;br /&gt;TUNNELS LEAD TO 7 16 18      &lt;br /&gt;&lt;br /&gt;SHOOT OR MOVE (S-M)&lt;br /&gt;?&lt;/pre&gt;&lt;br /&gt;It uses the code from &lt;a href="http://www.catb.org/~esr"&gt;ESR&lt;/a&gt;'s classic &lt;a href="http://freshmeat.net/projects/wumpus-classic"&gt;wumpus&lt;/a&gt; clone. (I checked with him to make sure he didn't mind wumpus being ported to such an unusual place).&lt;br /&gt;&lt;br /&gt;If you haven't seen "Hunt the Wumpus" before, it's a classic text game originally written in BASIC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-112772196720592876?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/112772196720592876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=112772196720592876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112772196720592876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112772196720592876'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/09/mdb-wumpus-ive-added-another-program.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-112772110213893056</id><published>2005-09-26T00:44:00.000-07:00</published><updated>2005-09-26T00:51:42.143-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DTraceToolkit 0.84&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The latest version of the DTraceToolkit has been uploaded. Visit the OpenSolaris&lt;br /&gt;&lt;a href="http://www.opensolaris.org/os/community/dtrace/dtracetoolkit"&gt;DTraceToolkit&lt;/a&gt; site to download it.&lt;br /&gt;&lt;br /&gt;Since version 0.82 I've updated several scripts and added a couple. Between now and version 1.00 there will be an emphasis on revisiting code, enhancing existing programs and writing more documentation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-112772110213893056?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/112772110213893056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=112772110213893056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112772110213893056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112772110213893056'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/09/dtracetoolkit-0.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-112520080210856669</id><published>2005-08-27T20:03:00.000-07:00</published><updated>2005-08-27T20:53:40.296-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;APC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Australian Personal Computer magazine is Australia's leading computer magazine, with the first issue printed in 1980. It's especially popular with PC or Windows enthusiasts, or those who work in that industry. People in the Unix, Linux or Solaris community don't seem to read it as much.&lt;br /&gt;&lt;br /&gt;Recently I wrote a workshop for the September issue that gave a detailed summary of configuring networking in Solaris 10. Networking has changed in Solaris 10, and it was great to cover what's new and how to use it (including SMF, ipnodes and IP Filter). I've spoken to a number of Solaris people about the article and most of them are suprised - APC is running articles on Solaris? &lt;br /&gt;&lt;br /&gt;Yes, APC is running articles on Solaris! And Linux, and Unix in general.&lt;br /&gt;&lt;br /&gt;APC July 2005 included Solaris 10 on the cover DVD, and a workshop to cover installing Solaris 10 and Windows, duel boot.&lt;br /&gt;&lt;br /&gt;APC August 2005 had an article on the future of chip technologies, covering Sun's Niagara CPU.&lt;br /&gt;&lt;br /&gt;APC September 2005 included a workshop on configuring networking on Solaris 10.&lt;br /&gt;&lt;br /&gt;If you aren't reading it and you live in Australia (or can arrange mail subscription?) it may well be worth a look. &lt;a href="http://www.apcmag.com"&gt;http://www.apcmag.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-112520080210856669?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/112520080210856669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=112520080210856669' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112520080210856669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/112520080210856669'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/08/apc-australian-personal-computer.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-111987570628783840</id><published>2005-06-27T05:19:00.000-07:00</published><updated>2005-06-27T05:40:12.076-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;DExplorer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've just uploaded dexplorer ver 0.75, and it's shaping up to be quite a useful tool.&lt;br /&gt;It runs a series of DTrace scripts that monitor generic system activity, and saves the output in a .tar.gz file with a meaningful structure,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.opensolaris.org/os/community/dtrace/dexplorer"&gt;http://www.opensolaris.org/os/community/dtrace/dexplorer&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.brendangregg.com/dtrace.html#DExplorer"&gt;http://www.brendangregg.com/dtrace.html#DExplorer&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The idea came from David Visser, Christopher Wells, and several other guys I met while in Melbourne, Australia last week. It's a great idea - it makes a lot of sense.&lt;br /&gt;&lt;br /&gt;Here I've expanded a .tar.gz file created by dexplorer to demo the contents,&lt;br /&gt;&lt;pre&gt;&lt;font size=-1&gt;# find de_jupiter_200506272230 -type f&lt;br /&gt;de_jupiter_200506272230/Cpu/interrupt_by_cpu&lt;br /&gt;de_jupiter_200506272230/Cpu/interrupt_time&lt;br /&gt;de_jupiter_200506272230/Cpu/dispqlen_by_cpu&lt;br /&gt;de_jupiter_200506272230/Cpu/sdt_count&lt;br /&gt;de_jupiter_200506272230/Disk/pgpgin_by_process&lt;br /&gt;de_jupiter_200506272230/Disk/fileopen_count&lt;br /&gt;de_jupiter_200506272230/Disk/sizedist_by_process&lt;br /&gt;de_jupiter_200506272230/Mem/minf_by_process&lt;br /&gt;de_jupiter_200506272230/Mem/vminfo_by_process&lt;br /&gt;de_jupiter_200506272230/Net/mib_data&lt;br /&gt;de_jupiter_200506272230/Net/tcpw_by_process&lt;br /&gt;de_jupiter_200506272230/Proc/sample_process&lt;br /&gt;de_jupiter_200506272230/Proc/syscall_by_process&lt;br /&gt;de_jupiter_200506272230/Proc/syscall_count&lt;br /&gt;de_jupiter_200506272230/Proc/readb_by_process&lt;br /&gt;de_jupiter_200506272230/Proc/writeb_by_process&lt;br /&gt;de_jupiter_200506272230/Proc/sysinfo_by_process&lt;br /&gt;de_jupiter_200506272230/Proc/newprocess_count&lt;br /&gt;de_jupiter_200506272230/Proc/signal_count&lt;br /&gt;de_jupiter_200506272230/Proc/syscall_errors&lt;br /&gt;de_jupiter_200506272230/Info/uname-a&lt;br /&gt;de_jupiter_200506272230/Info/psrinfo-v&lt;br /&gt;de_jupiter_200506272230/Info/prtconf&lt;br /&gt;de_jupiter_200506272230/Info/df-k&lt;br /&gt;de_jupiter_200506272230/Info/ifconfig-a&lt;br /&gt;de_jupiter_200506272230/Info/ps-o&lt;br /&gt;de_jupiter_200506272230/Info/uptime&lt;br /&gt;de_jupiter_200506272230/log&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;Lots of goodies to pick over. &lt;br /&gt;&lt;br /&gt;The names of the files should indicate their contents. Many of them contain quite generic data, the idea is that one dexplorer file should contain as many statistics as possible. &lt;br /&gt;&lt;br /&gt;Check for updates. I'll also throw it in the DTraceToolkit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-111987570628783840?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/111987570628783840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=111987570628783840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/111987570628783840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/111987570628783840'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/06/dexplorer-ive-just-uploaded-dexplorer.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13965874.post-111977818783887084</id><published>2005-06-26T01:11:00.000-07:00</published><updated>2005-06-27T05:43:11.796-07:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Created This&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;G'Day,&lt;br /&gt;&lt;br /&gt;Back in 1996 I created a personal website to host various stuff, including artwork I had created using &lt;a href="http://www.povray.org"&gt;Povray&lt;/a&gt;. It also contained a message board called "The Wall", inspired by message boards I had been using on BBSes. People thought it was a dumb idea, some even horrified with the audacity of a personal website. I deleted it. Times have changed - personal websites are now more acceptable, and message boards or "blogs" are commonplace. "The Wall" is back.&lt;br /&gt;&lt;br /&gt;Recently I have been doing various tricks with code, especially &lt;a href="http://www.opensolaris.org/os/community/dtrace"&gt;DTrace&lt;/a&gt; and &lt;a href="http://www.opensolaris.org"&gt;OpenSolaris&lt;/a&gt;, and a blog seems like a useful way to share them. You'll probably find postings on computer programming languages including C, Perl, shell scripting and DTrace, plus various other topics of interest - AI programming, photography, rocketry, engineering, particle physics, beer, gaming, etc.&lt;br /&gt;&lt;br /&gt;I'll try to get to the point. I'll also try to spell correctly. :-)&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;Brendan&lt;br /&gt;&lt;br /&gt;[Sydney, Australia]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13965874-111977818783887084?l=bdgregg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bdgregg.blogspot.com/feeds/111977818783887084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13965874&amp;postID=111977818783887084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/111977818783887084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13965874/posts/default/111977818783887084'/><link rel='alternate' type='text/html' href='http://bdgregg.blogspot.com/2005/06/created-this-gday-back-in-1996-i.html' title=''/><author><name>Brendan Gregg</name><uri>http://www.blogger.com/profile/03662900777558310512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
