posix_trace_attr_getmaxusereventsize Subroutine

Purpose

Retrieves the maximum size of an user event for a given length.

Library

Posix Trace Library (libposixtrace.a)

Syntax

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

int posix_trace_attr_getmaxusereventsize(attr, data_len, eventsize)
const trace_attr_t *restrict attr;
size_t data_len;
size_t *restrict eventsize;

Description

The posix_trace_attr_getmaxusereventsize subroutine calculates the maximum size, in bytes, of memory that is required to store a single user trace event that is generated by the posix_trace_event subroutine with a data_len parameter equal to the data_len value specified in this subroutine. The size value is calculated for the trace stream attributes object pointed to by the attr parameter, and is returned in the variable specified by the eventsize parameter.

If this subroutine is called with a non-initialized attributes object as parameter, the result is not specified.

Parameters

Item Description
attr Specifies the trace attributes object.
data_len Specifies the data_len parameter that is used to compute the maximum memory size that is required to stored a single user trace event.
eventsize Specifies where the attr object, in bytes, will be stored.

Return Values

Upon successful completion, this subroutine returns a value of zero. Otherwise, it returns the corresponding error number.

The posix_trace_attr_getmaxusereventsize subroutine stores the maximum memory size to store a single user trace event in the object pointed to by the eventsize parameter, if successful.

Errors

This subroutine fails if the following error number returns:
Item Description
EINVAL The attr parameter is null or the other parameters are not valid.

Files

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