Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dtrace_stop (3DTRACE)

Name

dtrace_go, dtrace_stop - Start and stop tracing

Synopsis

     cc [ flag... ] file... -ldtrace [ library... ]
     #include <dtrace.h>

     int dtrace_go(dtrace_hdl_t *dtp)

     int dtrace_stop(dtrace_hdl_t *dtp)

Description

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.

Return Values

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.

Errors

The dtrace_go() function will fail if:

EINVAL

The DTrace handle is NULL or the DTrace handle is already active because the consumer has called the dtrace_go() function using this handle.

EDT_DESTRUCTIVE

A destructive action was specified in the program, but destructive actions are not allowed.

EDT_ISANON

An attempt was made to claim anonymous state by setting the –grabanon option while running a separate D program.

EDT_NOANON

An attempt was made to claim anonymous state, but no anonymous state was available.

EDT_ENDTOOBIG

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.

EDT_BUFTOOSMALL

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:

EINVAL

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.

EFAULT

The kernel was unable to copy out the final status for this program.

Examples

See the libdtrace(3LIB) man page for an example of using the dtrace_go() and dtrace_stop() functions.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
all
Availability
system/dtrace
Interface Stability
Committed
MT-Level
Safe

See Also

libdtrace(3LIB), dtrace_errno(3DTRACE), dtrace_setopt(3DTRACE)