Chapter 4 Actions and Subroutines

Table of Contents

4.1 Actions
4.2 Default Action
4.3 Data Recording Actions
4.3.1 freopen
4.3.2 ftruncate
4.3.3 func
4.3.4 mod
4.3.5 printa
4.3.6 printf
4.3.7 stack
4.3.8 sym
4.3.9 trace
4.3.10 tracemem
4.3.11 ustack
4.3.12 uaddr
4.3.13 usym
4.4 Destructive Actions
4.4.1 Process Destructive Actions
4.4.2 Kernel Destructive Actions
4.5 Special Actions
4.5.1 Speculative Actions
4.5.2 exit
4.5.3 setopt
4.6 Subroutines
4.6.1 alloca
4.6.2 basename
4.6.3 bcopy
4.6.4 cleanpath
4.6.5 copyin
4.6.6 copyinstr
4.6.7 copyinto
4.6.8 d_path
4.6.9 dirname
4.6.10 getmajor
4.6.11 getminor
4.6.12 htonl
4.6.13 htonll
4.6.14 htons
4.6.15 index
4.6.16 inet_ntoa
4.6.17 inet_ntoa6
4.6.18 inet_ntop
4.6.19 lltostr
4.6.20 mutex_owned
4.6.21 mutex_owner
4.6.22 mutex_type_adaptive
4.6.23 mutex_type_spin
4.6.24 ntohl
4.6.25 ntohll
4.6.26 ntohs
4.6.27 progenyof
4.6.28 rand
4.6.29 rindex
4.6.30 rw_iswriter
4.6.31 rw_read_held
4.6.32 rw_write_held
4.6.33 speculation
4.6.34 strchr
4.6.35 strjoin
4.6.36 strlen
4.6.37 strrchr
4.6.38 strstr
4.6.39 strtok
4.6.40 substr

You can use D function calls such as trace and printf to invoke two different kinds of services provided by DTrace: actions that trace data or modify state external to DTrace, and subroutines that affect only internal DTrace state.

This chapter defines actions and subroutines, and describes their syntax and semantics.