dtrace:examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dtrace:examples [2009/12/04 16:14] – StaceySondtrace:examples [2020/12/25 15:22] (current) – Update probe name for priv-err RobertWatson
Line 6: Line 6:
  
 <code> <code>
-callout_execute:::callout_start+callout_execute:::callout-start
 { {
         self->cstart = timestamp;         self->cstart = timestamp;
 } }
  
-callout_execute:::callout_end+callout_execute:::callout-end
 { {
  
Line 55: Line 55:
  
 ===== Measure total time spent in each callout handler over 1-second intervals ===== ===== Measure total time spent in each callout handler over 1-second intervals =====
-This script is loosely based on a similar one from [[/OpenSolaris|OpenSolaris]]'s sdt Provider page, but due to slight differences in types and probe naming, we can't use theirs verbatim:+This script is loosely based on a similar one from %%OpenSolaris%%'s sdt Provider page, but due to slight differences in types and probe naming, we can't use theirs verbatim:
  
 <code> <code>
 #pragma D option quiet #pragma D option quiet
  
-callout_execute:::callout_start+callout_execute:::callout-start
 { {
         self->cstart = timestamp;         self->cstart = timestamp;
 } }
  
-callout_execute:::callout_end+callout_execute:::callout-end
 { {
  
Line 86: Line 86:
  
 Submitted by [[/RobertWatson|RobertWatson]]. Submitted by [[/RobertWatson|RobertWatson]].
 +
 +Note: Probes were named callout_start and callout_end in older versions.
  
 This script works by measuring the time at the start of a callout, then again on termination and billing that time incrementally to the callout function that ran.  Once a second, we print the results and reset the counters. This script works by measuring the time at the start of a callout, then again on termination and billing that time incrementally to the callout function that ran.  Once a second, we print the results and reset the counters.
Line 168: Line 170:
  
 <code> <code>
-priv:::priv_err+priv:::priv-err
 { {
         @traces[stack()] = count();         @traces[stack()] = count();
Line 215: Line 217:
 ===== Histogram of time spent waiting on NFSv3 RPCs by system call ===== ===== Histogram of time spent waiting on NFSv3 RPCs by system call =====
 This script measures all time spent waiting on RPC replies for each system call, and then generates a histogram of those times sorted by system call name. This script measures all time spent waiting on RPC replies for each system call, and then generates a histogram of those times sorted by system call name.
 +
 +Exists in %%FreeBSD%% as ''%%/usr/src/share/dtrace/nfsclienttime%%''.
  
 <code> <code>
Line 307: Line 311:
  
 This script creates a trace of NFS RPCs, NFS attribute cache activity, and NFS access cache activity, along with the system call that instigated the activity.  Notice that NFS events may happen outside of the context of a system call, most likely due to the VM system paging from NFS, in which case the system call name is reported as "-". This script creates a trace of NFS RPCs, NFS attribute cache activity, and NFS access cache activity, along with the system call that instigated the activity.  Notice that NFS events may happen outside of the context of a system call, most likely due to the VM system paging from NFS, in which case the system call name is reported as "-".
 +
 +Exists in %%FreeBSD%% as ''%%/usr/src/share/dtrace/nfsattrstats%%''.
  
 <code> <code>
Line 409: Line 415:
 ---- ----
  
-[[/CategoryDTrace|CategoryDTrace]]+{{tag>Dtrace HowTo}}
  
  • dtrace/examples.1259943254.txt.gz
  • Last modified: 2009/12/04 16:14
  • by StaceySon