User Tools

Site Tools


solaris:dtrace_work.3dtrace

dtrace_work


NAME

dtrace_work - DTrace work interface

SYNOPSIS

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

dtrace_workstatus_t dtrace_work(dtrace_hdl_t *dtp, FILE *fp,

dtrace_consume_probe_f *pfunc, dtrace_consume_rec_f *rfunc, void *arg)

DESCRIPTION

The dtrace_work() function consumes traced data and snapshots aggregation data. The dtp argument is the DTrace handle as returned by the dtrace_open(3DTRACE) function. The fp argument is the file pointer for any output. The pfunc argument is a function to be called to process data from this enabled probe. The rfunc argument is a function to be called to process data from individual data records. arg is a user-defined argument to be passed to these two callback functions. See the dtrace_consume(3DTRACE) man page for a description of these callback functions.

RETURN VALUES

Upon successful completion, the dtrace_work() function returns the value, DTRACE_WORKSTATUS_OKAY or DTRACE_WORKSTATUS_DONE. On failure, the function returns the value DTRACE_WORKSTATUS_ERROR and sets the DTrace error number to indicate the reason for the failure. See the dtrace_errno(3DTRACE) man page for more information.

ERRORS

The dtrace_work() function will fail if:

EINVAL

The dtp argument is NULL.

EFAULT

The system encountered an error when copying out the status for this DTrace handle.

EDT_NOTACTIVE

The DTrace handle is not active because the dtrace_go(3DTRACE) function has not been called yet.

EDT_BRICKED

DTrace has self-terminated for some reason.

EDT_DROPABORT

The D program is aborting due to dropped data. Data is dropped either because an installed a drop handler has explicitly returned the value, DTRACE_HANDLE_ABORT, or there is no drop handler.

EDT_NOMEM

The system was unable to allocate memory while processing this function.

EXAMPLES

See the libdtrace(3LIB) man page for an example of using the dtrace_work() function.

ATTRIBUTES

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

SEE ALSO

libdtrace(3LIB), dtrace_errno(3DTRACE)


solaris/dtrace_work.3dtrace.txt · Last modified: 2023/07/19 08:58 by A User Not Logged in