Built-in Variables

The following table provides a complete list of D built-in variables. All of these variables are scalar global variables; no thread-local or clause-local variables or built-in associative arrays are currently defined by D.

Table 3–1 DTrace Built-in Variables

Type and Name

Description

int64_t arg0, ..., arg9

The first ten input arguments to a probe represented as raw 64-bit integers. If fewer than ten arguments are passed to the current probe, the remaining variables return zero.

args[]

The typed arguments to the current probe, if any. The args[] array is accessed using an integer index, but each element is defined to be the type corresponding to the given probe argument. For example, if args[] is referenced by a read(2) system call probe, args[0] is of type int, args[1] is of type void *, and args[2] is of type size_t.

uintptr_t caller

The program counter location of the current thread just before entering the current probe.

The lightweight process (LWP) state of the LWP associated with the current thread. This structure is described in further detail in theproc(4) man page.

psinfo_t *curpsinfo

The process state of the process associated with the current thread. This structure is described in further detail in the proc(4) man page.

kthread_t *curthread

The address of the operating system kernel's internal data structure for the current thread, the kthread_t. The kthread_t is defined in <sys/thread.h>. Refer to Solaris Internals for more information on this variable and other operating system data structures.

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 identifiers 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.

The probe ID for the current probe. This ID is the system-wide unique identifier for the probe as published by DTrace and listed in the output of dtrace-l.

uint_t ipl

The interrupt priority level (IPL) on the current CPU at probe firing time. Refer to Solaris Internals for more information on interrupt levels and interrupt handling in the Solaris operating system kernel.

lgrp_id_t lgrp

The latency group ID for the latency group of which the current CPU is a member. See Chapter 26, sched Provider for more information.

The current value of a nanosecond timestamp counter that is virtualized to the amount of time that the current thread has been running on a CPU, minus the time spent in DTrace predicates and actions. This counter increments from an arbitrary point in the past and should only be used for relative time computations.

uint64_t walltimestamp

The current number of nanoseconds since 00:00 Universal Coordinated Time, January 1, 1970.