DTrace for FreeBSD - Status Update

From: John Birrell <jb_at_what-creek.com>
Date: Thu, 25 May 2006 06:55:10 +0000
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;
        _at_[stringof(mt->ks_shortdesc)] = quantize(arg0)
}


The output:


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

  ufs_dirhash                                       
           value  ------------- Distribution ------------- count    
               4 |                                         0        
               8 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_              6        
              16 |                                         0        
              32 |                                         0        
              64 |                                         0        
             128 |                                         0        
             256 |_at__at__at__at__at__at__at__at__at__at__at__at__at_                            3        
             512 |                                         0        

  UMAHash                                           
           value  ------------- Distribution ------------- count    
             512 |                                         0        
            1024 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 1        
            2048 |                                         0        

  vnodemarker                                       
           value  ------------- Distribution ------------- count    
             128 |                                         0        
             256 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 6        
             512 |                                         0        

  Unitno                                            
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 130      
              32 |                                         0        

  sysctl                                            
           value  ------------- Distribution ------------- count    
               4 |                                         0        
               8 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                       77       
              16 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                   95       
              32 |                                         0        

  DEVFS3                                            
           value  ------------- Distribution ------------- count    
              32 |                                         0        
              64 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 56       
             128 |                                         0        

  plimit                                            
           value  ------------- Distribution ------------- count    
              64 |                                         0        
             128 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 28       
             256 |                                         0        

  proc-args                                         
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                   48       
              64 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                       38       
             128 |                                         0        

  zombie                                            
           value  ------------- Distribution ------------- count    
              32 |                                         0        
              64 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 86       
             128 |                                         0        

  kmem                                              
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_             24       
              64 |                                         0        
             128 |                                         0        
             256 |                                         0        
             512 |_at__at__at__at__at__at__at__at__at__at__at__at_                             10       
            1024 |                                         0        

  sysctltmp                                         
           value  ------------- Distribution ------------- count    
               2 |                                         0        
               4 |_at__at__at__at__at_                                    28       
               8 |_at__at__at__at__at__at__at__at__at__at_                               56       
              16 |_at__at__at__at__at__at__at__at__at__at_                               56       
              32 |_at__at__at__at__at__at__at__at__at__at_                               56       
              64 |                                         0        
             128 |_at__at__at__at__at_                                    28       
             256 |                                         0        

  filedesc                                          
           value  ------------- Distribution ------------- count    
              64 |                                         0        
             128 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 86       
             256 |                                         0        

  nfsclient_req                                     
           value  ------------- Distribution ------------- count    
              32 |                                         0        
              64 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 213      
             128 |                                         0        

  DEVFS1                                            
           value  ------------- Distribution ------------- count    
              64 |                                         0        
             128 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 112      
             256 |                                         0        

  ioctlops                                          
           value  ------------- Distribution ------------- count    
               2 |                                         0        
               4 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                     573      
               8 |_at_                                        30       
              16 |_at__at_                                       60       
              32 |_at__at__at__at__at__at__at__at__at_                                264      
              64 |_at__at_                                       60       
             128 |                                         0        
             256 |_at__at__at__at__at__at_                                   175      
             512 |                                         0        

  soname                                            
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 8991     
              32 |                                         0        

  subproc                                           
           value  ------------- Distribution ------------- count    
            1024 |                                         0        
            2048 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 86       
            4096 |                                         0        

  cred                                              
           value  ------------- Distribution ------------- count    
              32 |                                         0        
              64 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_ 10403    
             128 |                                         0        

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

  temp                                              
           value  ------------- Distribution ------------- count    
               4 |                                         0        
               8 |_at__at__at__at__at__at__at__at__at__at__at__at__at_                            935      
              16 |_at__at_                                       151      
              32 |_at__at__at_                                      184      
              64 |_at_                                        66       
             128 |_at_                                        97       
             256 |                                         30       
             512 |                                         22       
            1024 |                                         13       
            2048 |                                         4        
            4096 |                                         28       
            8192 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                      1359     
           16384 |                                         0        

  dtrace                                            
           value  ------------- Distribution ------------- count    
               0 |                                         0        
               1 |_at_                                        23       
               2 |                                         19       
               4 |_at__at__at_                                      118      
               8 |_at__at__at__at__at_                                    182      
              16 |_at__at__at__at__at_                                    211      
              32 |_at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at__at_                        689      
              64 |_at_                                        31       
             128 |_at_                                        29       
             256 |_at__at_                                       99       
             512 |_at_                                        24       
            1024 |_at__at__at_                                      135      
            2048 |                                         5        
            4096 |                                         0        
            8192 |                                         0        
           16384 |                                         0        
           32768 |                                         0        
           65536 |                                         0        
          131072 |                                         0        
          262144 |                                         0        
          524288 |                                         0        
         1048576 |                                         10       
         2097152 |                                         0        
         4194304 |_at_                                        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
Received on Thu May 25 2006 - 04:55:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:56 UTC