4.5 Special Actions

4.5.1 Speculative Actions
4.5.2 exit
4.5.3 setopt

This section describes actions that are not data recording actions or destructive actions.

4.5.1 Speculative Actions

The actions associated with speculative tracing are speculate, commit, and discard. These actions are discussed in Chapter 7, Speculative Tracing.

4.5.2 exit

void exit(int status)

The exit action is used to immediately stop tracing, and to inform the DTrace consumer that it should cease tracing, perform any final processing, and call exit() with the specified status value. Because exit returns a status to user level, it is a data recording action, However, unlike other data storing actions, exit cannot be speculatively traced. exit causes the DTrace consumer to exit regardless of buffer policy. Because exit is a data recording action, it can be dropped.

When exit is called, only DTrace actions already in progress on other CPUs are completed. No new actions occur on any CPU. The only exception to this rule is the processing of the END probe, which is called after the DTrace consumer has processed the exit action, and indicates that tracing should stop.

4.5.3 setopt

void setopt(const char *opt_name)
void setopt(const char *opt_name, const char *opt_value)

The setopt action allows you to dynamically specify a DTrace option, for example:

setopt("quiet");

setopt("bufsize", "50m");

setopt("aggrate", "2hz");