Alan Hargreaves' Weblog

The ramblings of an Australian SaND TSC* Principal Field Technologist

* Solaris and Network Domain Technology Support Centre - The group I work for

Tags

(update 1) acoustic bind birthday blues bugs cec cec2007 cec2008 china cmt contention cringley debugging dogs dtrace earthquake encumbered-binaries extra flash funny google guitar halloween huron install kids linux liveupgrade locking mdb music mysql newyear niagra openjava opensolaris oracle patches patents percussion performance redhat secondlife security solaris sru sun support sxcr t2 t2000 timeslider ufs upgrade virtualbox windows youtube zfs
pageicon Wednesday Nov 09, 2005

Gman's DTrace moment

Just noticed Glynn had a DTrace moment.

He was simply looking at the entry probes.

I'm sure he'll find the following even more interesting (remember that this script will need ctrl-c to exit it):


#!/usr/sbin/dtrace -s

#pragma D option flowindent

pid$target:gedit::entry,
pid$target:gedit::return
{}

This one will show the entry and exit of user space functions, in addition to indenting for each stack level. Showing stuff like:

  2  -> gedit_tooltips_event_handler
  2    -> get_keyboard_mode
  2    <- get_keyboard_mode
  2    -> gedit_tooltips_data_get
  2    <- gedit_tooltips_data_get
  2  <- gedit_tooltips_event_handler

Of course you could get even more interesting with the following:

#!/usr/sbin/dtrace -s

#pragma D option flowindent

pid$target:gedit::entry
/!self->interest/
{self->interest = 1}

pid$target:::entry,
pid$target:::return
/self->interest/
{trace(probemod)}

I'll leave it as an exercise to the reader as to what this one adds in. Hint, you might want to redirect the output, there is likely to be a bit.

For those who are a little more game, you could try adding the following to the previous script. Be aware that it's going to make things a little busy for a bit. Don't forget ctrl-c to exit it. It wil take a little bit to catch up after the ctrl-c.

fbt:::
/self->interest/
{trace("KERNEL")}

Technorati Tags: , ,

Comments:

Post a Comment:
Comments are closed for this entry.