Solaris Dynamic Tracing Guide
Previous Next

Arguments

The arguments to sysinfo probes are as follows:

arg0

The value by which the statistic is to be incremented. For most probes, this argument is always 1, but for some probes this argument may take other values.

arg1

A pointer to the current value of the statistic to be incremented. This value is a 64–bit quantity that will be incremented by the value in arg0. Dereferencing this pointer enables consumers to determine the current count of the statistic corresponding to the probe.

arg2

A pointer to the cpu_t structure that corresponds to the CPU on which the statistic is to be incremented. This structure is defined in <sys/cpuvar.h>, but it is part of the kernel implementation and should be considered Private.

The value of arg0 is 1 for most sysinfo probes. However, the readch and writech probes set arg0 to the number of bytes read or written, respectively. This features permits you to determine the size of reads by executable name, as shown in the following example:

# dtrace -n readch'{@[execname] = quantize(arg0)}'
dtrace: description 'readch' matched 4 probes
^C
  xclock                                            
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
              64 |                                         0        

  acroread                                          
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3        
              64 |                                         0        

  FvwmAuto                                          
           value  ------------- Distribution ------------- count    
               2 |                                         0        
               4 |@@@@@@@@@@@@@                            13       
               8 |@@@@@@@@@@@@@@@@@@@@@                    21       
              16 |@@@@@                                    5        
              32 |                                         0        

  xterm                                             
           value  ------------- Distribution ------------- count    
              16 |                                         0        
              32 |@@@@@@@@@@@@@@@@@@@@@@@@                 19       
              64 |@@@@@@@@@                                7        
             128 |@@@@@@                                   5        
             256 |                                         0        

  fvwm2                                             
           value  ------------- Distribution ------------- count    
              -1 |                                         0        
               0 |@@@@@@@@@                                186      
               1 |                                         0        
               2 |                                         0        
               4 |@@                                       51       
               8 |                                         17       
              16 |                                         0        
              32 |@@@@@@@@@@@@@@@@@@@@@@@@@@               503      
              64 |                                         9        
             128 |                                         0        

  Xsun                                              
           value  ------------- Distribution ------------- count    
              -1 |                                         0        
               0 |@@@@@@@@@@@                              269      
               1 |                                         0        
               2 |                                         0        
               4 |                                         2        
               8 |@                                        31       
              16 |@@@@@                                    128      
              32 |@@@@@@@                                  171      
              64 |@                                        33       
             128 |@@@                                      85       
             256 |@                                        24       
             512 |                                         8        
            1024 |                                         21       
            2048 |@                                        26       
            4096 |                                         21       
            8192 |@@@@                                     94       
           16384 |                                         0

The sysinfo provider sets arg2 to be a pointer to a cpu_t, a structure internal to the kernel implementation. The sysinfo probes fire on the CPU on which the statistic is being incremented. Use the cpu_id member of the cpu_t structure to determine the CPU of interest.

Previous Next