dtrace_go, dtrace_stop - Start and stop tracing
cc [ flag... ] file... -ldtrace [ library... ] #include <dtrace.h> int dtrace_go(dtrace_hdl_t *dtp) int dtrace_stop(dtrace_hdl_t *dtp)
The dtrace_go() function causes tracing to begin for a D program that has been compiled using the dtrace_program_strcompile(3DTRACE) or the dtrace_program_fcompile(3DTRACE) function, and downloaded into the kernel using the dtrace_program_exec(3DTRACE) function.
The dtrace_stop() function stops tracing for the running D program associated with the DTrace handle, dtp.
On successful completion, these functions return 0. Otherwise they return -1 and set the DTrace error number to indicate the reason for the failure. See the dtrace_errno(3DTRACE) man page for more information.
The dtrace_go() function will fail if:
The DTrace handle is NULL or the DTrace handle is already active because the consumer has called the dtrace_go() function using this handle.
A destructive action was specified in the program, but destructive actions are not allowed.
An attempt was made to claim anonymous state by setting the –grabanon option while running a separate D program.
An attempt was made to claim anonymous state, but no anonymous state was available.
There is insufficient principal buffer space to reserve for the END probe enablings. This is only applicable if the buffer policy is set to fill.
No space has been allocated for the principal, aggregation, or speculation buffer, but the D program requires space for the buffer.
The dtrace_stop() function will fail if:
The DTrace handle is NULL or the DTrace handle is not active because the dtrace_go() function has not yet been called on this handle.
The kernel was unable to copy out the final status for this program.
See the libdtrace(3LIB) man page for an example of using the dtrace_go() and dtrace_stop() functions.
See attributes(7) for descriptions of the following attributes:
|
libdtrace(3LIB), dtrace_errno(3DTRACE), dtrace_setopt(3DTRACE)