etap_trace_event


System Trap - manipulate event probes and lock event tracing.

SYNOPSIS

#include<mach/etap.h>

kern_return_t   etap_trace_event
                (etap_data_t                               mode,
                 mode                                      type,
                 boolean_t                               enable,
                 enable                                   nargs,
                 mode                                      mode);

PARAMETERS

mode
indicates the desired trace flavor or reset option and may be one, or more, of the following:

type
used when measuring lock event contention or durations and may be one, or more, of the following:

enable
a boolean value indicattin whether the event trace operation is to be enabled (TRUE) or disabled (FALSE).

nargs
specifies how many arguments are passed in the args array.

args
an array, each element of which is a character string representing a specific subsystem or event type. These values must correspond to the ones the kernel uses to represent the same subsystems and event types. The maximum length of a character string is EVENT_NAME_LENGTH (defined in mach/etap.h).

DESCRIPTION

The etap_trace_event system call is used to enable and disable kernel event probes (of a specified type) and all modes of lock event tracing. The call also supports a reset option, where the cumulative buffer data and all event type tracing is reset to zero. When the reset option is used, a new interval width can also be defined, using the nargs parameter.

To reset the ETAP instrumentation, the system call would utilize the mode parameter, passing the value of ETAP_RESET (All other parameters may equal NULL). If, at the time of reset, the nargs parameter is assigned a value, then the cumulative buffer interval width will be adjusted to be the size of that value. For example, the following system call would reset the ETAP instrumentation and adjust the cumulative buffer's interval width to 100ms:

         etap_trace_event(ETAP_RESET, 0, 0, 100, 0);

RETURN VALUES

KERN_SUCCESS
The call was performed successfully.

KERN_NO_SPACE
A shortage of kernel resources prevented the operation from completing; the kernel has cleaned up all residual state (the error indicates a "clean" failure).

KERN_FAILURE
ETAP is not configured in the kernel.

RELATED INFORMATION

Functions: etap_probe, etap_trace_thread, etap_get_info.