Pimp My Trace

3:57 am General

In preparation for the Desktop Summit that we’re having internally inside Sun, I figured it was about time to start reading over the DTrace stuff so I don’t look like a complete idiot when I attend which would be rather embarassing.

So there I was just playing around with scripts figuring out how the probes and providers, and the predicates and aggregations work – still mostly in kernel land where WHOOOOOSH everything goes over my head.

Then I stumbled across my next example, and I had an ‘OH MY GOD, THIS IS FUCKING UNBELIEVABLE’ epiphany –

# dtrace -n 'pid$target:gedit::entry { }' -c 'gedit'
dtrace: description 'pid$target:gedit::entry ' matched 1359 probes
dtrace: buffer size lowered to 2m
CPU     ID                    FUNCTION:NAME
  0  74350                     _start:entry 
  0  74351                      __fsr:entry 
  0  74356                       main:entry 
  0  74423           gedit_debug_init:entry 
  0  74424        gedit_debug_message:entry 
  0  74424        gedit_debug_message:entry 
....

And I started watching it, and more information spewed out at the terminal as I interacted with the user interface. I’m sure I’m only touching the iceberg of how useful this is going to be in the future. Sure, it’s only as useful as the hands of the developer, and I still suck at writing code.

But any developer who hasn’t had a serious play with this is still in a world of black and white. Find your colour folks. Pimp your Trace!

Update: Alan takes things a step further.

Comments are closed.