Chapter 10. Actions and Subroutines

Table of Contents

Actions
Default Action
Data Recording Actions
trace
tracemem
printf
printa
stack
ustack
jstack
Destructive Actions
Process Destructive Actions
Kernel Destructive Actions
Special Actions
Speculative Actions
exit
Subroutines
alloca
basename
bcopy
cleanpath
copyin
copyinstr
copyinto
dirname
msgdsize
msgsize
mutex_owned
mutex_owner
mutex_type_adaptive
progenyof
rand
rw_iswriter
rw_write_held
speculation
strjoin
strlen

Actions

Actions enable your DTrace programs to interact with the system outside of DTrace. The most common actions record data to a DTrace buffer. Other actions are available, such as stopping the current process, raising a specific signal on the current process, or ceasing tracing altogether. Some of these actions are destructive in that they change the system, albeit in a well-defined way. These actions may only be used if destructive actions have been explicitly enabled. By default, data recording actions record data to the principal buffer. For more details on the principal buffer and buffer policies, see Chapter 11, Buffers and Buffering.