Wednesday, February 02, 2005

DTrace real life example

Here you can find post by Eric Schrock which is a real life story of using DTrace. It shows how simple problem could be answered easily with DTrace and how hard question it would be without DTrace. I've seen a lot of such examples here were I work. Have to find some time to post such real life examples with some description - promise I will.

Funny thing yesterday - I was reading some email exchange between two our developers (I was in Cc) - they were trying to find out what given application which was consuming whole CPU was doing. First truss then DTrace... it looked like no syscalls or application internal functions were called (PID provider r00lez). So question was raised - in what function is this application in? Heh, we all love DTrace, don't we? So they were trying with DTrace without luck (actually it's easy to do it, it's just that everybody learns)... But what was surprising was that they forgot about such simple tool as pstack which would give them answer in a second :) I couldn't resist to ask when they will check actual system time or who is logged in with DTrace instead of using date or w utils :)))) And actually I did check system time:

$ dtrace -qn BEGIN'{printf("%d\n", `time);}'

$ perl -e 'print localtime(1107312364) . "\n";'
Wed Feb 2 03:46:04 2005

Then one of them wrote - but still you had to use Perl... I replied - actually not... all you have to do in D is ... :)))))

1 comment:

Anonymous said...

You started well, but confused later. You could have put up some more useful information.