posix_trace_event Subroutine

Purpose

Trace subroutines for implementing a trace point.

Library

Posix Trace Library (libposixtrace.a)

Syntax

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

void posix_trace_event(event_id, data_ptr, data_len)
trace_event_id_t event_id;
const void *restrict data_ptr;
size_t data_len;

Description

In the trace stream that calling process is being traced and the event_id is not filtered out, the posix_trace_event subroutine records the values of the event_id parameter and the user data, which is specified by the data_ptr parameter.

The data_len parameter represents the total size of the user trace event data. If the value of the data_len is not larger than the declared maximum size for user trace event data, the truncation-status attribute of the trace event recorded is POSIX_TRACE_NOT_TRUNCATED. Otherwise, the user trace event data is truncated to this declared maximum size and the truncation-status attribute of the trace event recorded is POSIX_TRACE_TRUNCATED_RECORD.

The posix_trace_event subroutine has no effect in the following situations:
  • No trace stream is created for the process.
  • The created trace stream is not running.
  • The trace event specified by the event_id parameter is filtered out in the trace stream.

Parameter

Item Description
event_id Specifies the trace event identifier.
data_ptr Specifies the user data to be written in the trace streams that the process is tracing in.
data_len Specifies the length of the user data to be written.

Return Values

No return value is defined for the posix_trace_event subroutine.

Errors

This subroutine returns no error code when it fails.

Files

The trace.h and types.h files in AIX® Version 7.1 Files Reference