trace_logbc()

Insert a trace event of an arbitrary class and type with arbitrary data

Synopsis:

#include <sys/neutrino.h>
#include <sys/trace.h>

int trace_logbc( int class,
                 int event,
                 const void *data,
                 size_t nbytes );

Arguments:

class
The class of event that you want to insert.
event
The type of event that you want to insert.
data
A pointer to the data to include with the event.
nbytes
The length of the data, in bytes. The function converts this value into the number of 32-bit integers.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The trace_logbc() function calls TraceEvent() to insert an event of the given class and type with the given data. For information about the classes and events, see the Events and the Kernel chapter of the System Analysis Toolkit User's Guide.

Note: If the length of the data isn't an even multiple of 32-bit values, or the data address isn't 32-bit aligned, the function creates a temporary copy of the data.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

ECANCELED
The requested action has been canceled.
EFAULT
Bad internal trace buffer address. The requested action has been specified out of order.
ENOMEM
Insufficient memory to allocate the trace buffers.
ENOTSUP
The requested action isn't supported.
EPERM
The application doesn't have permission to perform the action.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes