chill (Kernel-Destructive)

void chill(int nanoseconds)

The chill action causes DTrace to spin for the specified number of nanoseconds. This action is primarily useful for exploring problems that might be timing related. For example, you can use this action to open race condition windows or bring periodic events into or out of phase with one another. Because interrupts are disabled while in DTrace probe context, any use of the chill action results in an interrupt, scheduling, or dispatch latency. Therefore, chill can cause unexpected systemic effects and therefore should not be used indiscriminately. Because system activity relies on periodic interrupt handling, DTrace refuses to execute the chill action for more than 500 milliseconds out of each one-second interval on any given CPU. If the maximum chill interval is exceeded, DTrace reports an illegal operation error:

# dtrace -w -n syscall::openat:entry'{chill(500000001)}'
dtrace: allowing destructive actions
dtrace: description 'syscall::openat:entry' matched 1 probe 
dtrace: 57 errors
CPU     ID                    FUNCTION:NAME 
dtrace: error on enabled probe ID 1 (ID 14: syscall::openat:entry): \
illegal operation in action #1

This limit is enforced even if the time is spread across multiple calls to chill or multiple DTrace consumers of a single probe. For example, the same error would be generated by running the following command:

# dtrace -w -n syscall::openat:entry'{chill(250000000); chill(250000001);}'