Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

DTrace for FreeBSD: John Birrell

DTrace for FreeBSD: John Birrell

The port of DTrace to FreeBSD was performed by John Birrell, a FreeBSD contributor who was based on the Victorian coast, Australia. His e-mail to freebsdcurrent@freebsd.org announcing DTrace for FreeBSD in May 2006 has been reproduced here, in memory of a remarkably talented and determined software engineer.

  Date: Wed May 24 23:55:12 PDT 2006
  From: John Birrell <jb@what-creek.com>
  Subject: DTrace for FreeBSD - Status Update

  It's nearly 8 weeks since I started porting DTrace to FreeBSD and I
  thought I would post a status update including today's significant
  emotional event. 8-)

  For those who don't know what DTrace is or which company designed it,
  here are a few links:

  The BigAdmin: <http://www.sun.com/bigadmin/content/dtrace/>
  A Blurb: <http://www.sun.com/2004-0518/feature/index.html>
  The Guide: <http://docs.sun.com/app/docs/doc/817-6223>
  My FreeBSD Project Page: <http://people.freebsd.org/~jb/dtrace/index.html>

  Much of the basic DTrace infrastructure is in place now. Of the 1039
  DTrace tests that Sun runs on Solaris, 793 now pass on FreeBSD.

  We've got the following providers:

  - dtrace
  - profile
  - syscall
  - sdt
  - fbt

  As of today, loading those providers on a GENERIC kernel gives 32,519
  probes.

  Today's significant emotional event added over 30,000 of those, thanks
  to the Function Boundary Tracing (fbt) provider. It provides the
  instrumentation of the entry and return of every (non-leaf) function
  in the kernel and (non-DTrace provider) modules.
  Here is an example of what fbt can do.... The following script creates
  a probe on the entry to the kernel malloc() function. It dereferences
  the second argument to the malloc_type structure and then quantizes the
  size of the mallocs being made according to the malloc type name.

  The script:

  fbt:kernel:malloc:entry
  {
          mt = (struct malloc_type *) arg1;
          @[stringof(mt->ks_shortdesc)] = quantize(arg0)
  }


  The output:


    vmem
             value  ------------- Distribution ------------- count
                 2 |                                         0
                 4 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 56
                 8 |                                         0

  [...]

    nfsserver_srvdesc
             value  ------------- Distribution ------------- count
                 4 |                                         0
                 8 |@@@@@@@@@@@@@@@@@@@@                     8991
                16 |                                         0
                32 |                                         0
                64 |                                         0
               128 |@@@@@@@@@@@@@@@@@@@@                     8991
               256 |                                         0

    temp
             value  ------------- Distribution ------------- count
                 4 |                                         0
                 8 |@@@@@@@@@@@@@                            935
                16 |@@                                       151
                32 |@@@                                      184
                64 |@                                        66
               128 |@                                        97
               256 |                                         30
               512 |                                         22
              1024 |                                         13
              2048 |                                         4
              4096 |                                         28
              8192 |@@@@@@@@@@@@@@@@@@@                      1359
             16384 |                                         0
  dtrace
            value  ------------- Distribution ------------- count
                0 |                                         0
                1 |@                                        23
                2 |                                         19
                4 |@@@                                      118
                8 |@@@@@                                    182
               16 |@@@@@                                    211
               32 |@@@@@@@@@@@@@@@@@                        689
               64 |@                                        31
              128 |@                                        29
              256 |@@                                       99
              512 |@                                        24
             1024 |@@@                                      135
             2048 |                                         5
             4096 |                                         0
             8192 |                                         0
            16384 |                                         0
            32768 |                                         0
            65536 |                                         0
           131072 |                                         0
           262144 |                                         0
           524288 |                                         0
          1048576 |                                         10
          2097152 |                                         0
          4194304 |@                                        20
          8388608 |                                         0

  There is still a lot of work to do and while that goes on, the code has
  to remain in the FreeBSD perforce server. It isn't ready to get merged
  into CVS-current yet.

  I have asked the perforce-admins to mirror the project out to CVS (via
  cvsup10.freebsd.org), but I'm not sure what the hold-up there is.

  I had hoped that one or two of the Google SoC students would contribute
  to this, but I only received one proposal and that wasn't for anything
  that would help get DTrace/FreeBSD completed.

  There are things people can do to help. Some of them are build related;
  some are build tool related; some are user-land DTrace specific; and the
  rest are kernel related. Speak up if you are interested in working on
  this!

  --
  John Birrell

					  


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint