DTrace Built-in Variables

 
By Ifeyinwa Okoye and John Stearns, August 2006  
 
DTrace Built-in Variables
 
 
Type and Name
Description
int64_t arg0, ..., arg9
The first 10 input arguments to a probe represented as raw 64-bit integers. If fewer than 10 arguments are passed to the current probe, the remaining variables return zero.
args[]
The typed arguments to the current probe, if any. args[] array is accessed using an integer index, but each element is defined to be the type corresponding to the given probe argument.
uintptr_t caller
The program counter location of the current thread just before entering the current probe.
chipid_t chip
The CPU chip identifier for the current physical chip.
processorid_t cpu
The CPU identifier for the current CPU.
cpuinfo_t *curcpu
The CPU information for the current CPU.
lwpsinfo_t *curlwpsinfo
The lightweight process (LWP) state of the LWP associated with the current thread.
psinfo_t *curpsinfo
The process state of the process associated with the current thread.
kthread_t *curthread
The address of the operating system kernel's internal data structure for the current thread, the kthread_t. kthread_t is defined in <sys/thread.h>.
string cwd
The name of the current working directory of the process associated with the current thread.
uint_t epid
The enabled probe ID (EPID) for the current probe. This integer uniquely identifies a particular probe that is enabled with a specific predicate and set of actions.
int errno
The error value returned by the last system call executed by this thread.
string execname
The name that was passed to exec(2) to execute the current process.
gid_t gid
The real group ID of the current process.
uint_t id
The probe ID for the current probe. This ID is the system-wide unique identifier for the probe as published by DTrace.
uint_t ipl
The interrupt priority level (IPL) on the current CPU at probe firing time.
lgrp_id_t lgrp
The latency group ID for the latency group of which the current CPU is a member.
pid_t pid
The process ID of the current process.
pid_t ppid
The parent process ID of the current process.
string probefunc
The function name portion of the current probe's description.
string probemod
The module name portion of the current probe's description.
string probename
The name portion of the current probe's description.
string probeprov
The provider name portion of the current probe's description.
psetid_t pset
The processor set ID for the processor set containing the current CPU.
string root
The name of the root directory of the process associated with the current thread.
uint_t stackdepth
The current thread's stack frame depth at probe firing time.
id_t tid
The thread ID of the current thread. For threads associated with user processes, this value is equal to the result of a call to pthread_self.
uint64_t timestamp
The current value of a nanosecond timestamp counter. This counter increments from an arbitrary point in the past and should only be used for relative computations.
uid_t uid
The real user ID of the current process.
uint64_t uregs[]
The current thread's saved user-mode register values at probe firing time.
uint64_t vtimestamp
The current value of a nanosecond timestamp counter that is the amount of time the current thread has been running on a CPU, minus the time spent in DTrace predicates and actions.
uint64_t walltimestamp
The current number of nanoseconds since 00:00 Universal Coordinated Time, January 1, 1970.