---
name: "posix_trace_attr_getlogsize"
section: "3p"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/posix_trace_attr_getlogsize"
---

# posix\_trace\_attr\_getlogsize(3p)

retrieve and set trace stream size attributes (TRACING)

## PROLOG

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME

posix\_trace\_attr\_getlogsize, posix\_trace\_attr\_getmaxdatasize, posix\_trace\_attr\_getmaxsystemeventsize, posix\_trace\_attr\_getmaxusereventsize, posix\_trace\_attr\_getstreamsize, posix\_trace\_attr\_setlogsize, posix\_trace\_attr\_setmaxdatasize, posix\_trace\_attr\_setstreamsize — retrieve and set trace stream size attributes (**TRACING**)

## SYNOPSIS

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

int posix\_trace\_attr\_getlogsize(const trace\_attr\_t \*restrict *attr*,\
     size\_t \*restrict *logsize*); int posix\_trace\_attr\_getmaxdatasize(const trace\_attr\_t \*restrict *attr*,\
     size\_t \*restrict *maxdatasize*); int posix\_trace\_attr\_getmaxsystemeventsize(\
     const trace\_attr\_t \*restrict *attr*,\
     size\_t \*restrict *eventsize*); int posix\_trace\_attr\_getmaxusereventsize(\
     const trace\_attr\_t \*restrict *attr*,\
     size\_t *data\_len*, size\_t \*restrict *eventsize*); int posix\_trace\_attr\_getstreamsize(const trace\_attr\_t \*restrict *attr*,\
     size\_t \*restrict *streamsize*); int posix\_trace\_attr\_setlogsize(trace\_attr\_t \**attr*,\
     size\_t *logsize*); int posix\_trace\_attr\_setmaxdatasize(trace\_attr\_t \**attr*,\
     size\_t *maxdatasize*); int posix\_trace\_attr\_setstreamsize(trace\_attr\_t \**attr*,\
     size\_t *streamsize*);

## DESCRIPTION

The *posix\_trace\_attr\_getlogsize*() function shall copy the log size, in bytes, from the *log-max-size* attribute of the attributes object pointed to by the *attr* argument into the variable pointed to by the *logsize* argument. This log size is the maximum total of bytes that shall be allocated for system and user trace events in the trace log. The default value for the *log-max-size* attribute is implementation-defined.

The *posix\_trace\_attr\_setlogsize*() function shall set the maximum allowed size, in bytes, in the *log-max-size* attribute of the attributes object pointed to by the *attr* argument, using the size value supplied by the *logsize* argument.

The trace log size shall be used if the *log-full-policy* attribute is set to POSIX\_TRACE\_LOOP or POSIX\_TRACE\_UNTIL\_FULL. If the *log-full-policy* attribute is set to POSIX\_TRACE\_APPEND, the implementation shall ignore the *log-max-size* attribute.

The *posix\_trace\_attr\_getmaxdatasize*() function shall copy the maximum user trace event data size, in bytes, from the *max-data-size* attribute of the attributes object pointed to by the *attr* argument into the variable pointed to by the *maxdatasize* argument. The default value for the *max-data-size* attribute is implementation-defined.

The *posix\_trace\_attr\_getmaxsystemeventsize*() function shall calculate the maximum memory size, in bytes, required to store a single system trace event. This value is calculated for the trace stream attributes object pointed to by the *attr* argument and is returned in the variable pointed to by the *eventsize* argument.

The values returned as the maximum memory sizes of the user and system trace events shall be such that if the sum of the maximum memory sizes of a set of the trace events that may be recorded in a trace stream is less than or equal to the *stream-min-size* attribute of that trace stream, the system provides the necessary resources for recording all those trace events, without loss.

The *posix\_trace\_attr\_getmaxusereventsize*() function shall calculate the maximum memory size, in bytes, required to store a single user trace event generated by a call to *posix\_trace\_event*() with a *data\_len* parameter equal to the *data\_len* value specified in this call. This value is calculated for the trace stream attributes object pointed to by the *attr* argument and is returned in the variable pointed to by the *eventsize* argument.

The *posix\_trace\_attr\_getstreamsize*() function shall copy the stream size, in bytes, from the *stream-min-size* attribute of the attributes object pointed to by the *attr* argument into the variable pointed to by the *streamsize* argument.

This stream size is the current total memory size reserved for system and user trace events in the trace stream. The default value for the *stream-min-size* attribute is implementation-defined. The stream size refers to memory used to store trace event records. Other stream data (for example, trace attribute values) shall not be included in this size.

The *posix\_trace\_attr\_setmaxdatasize*() function shall set the maximum allowed size, in bytes, in the *max-data-size* attribute of the attributes object pointed to by the *attr* argument, using the size value supplied by the *maxdatasize* argument. This maximum size is the maximum allowed size for the user data argument which may be passed to *posix\_trace\_event*(). The implementation shall be allowed to truncate data passed to *trace\_user\_event* which is longer than *maxdatasize*.

The *posix\_trace\_attr\_setstreamsize*() function shall set the minimum allowed size, in bytes, in the *stream-min-size* attribute of the attributes object pointed to by the *attr* argument, using the size value supplied by the *streamsize* argument.

## RETURN VALUE

Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding error number.

The *posix\_trace\_attr\_getlogsize*() function stores the maximum trace log allowed size in the object pointed to by *logsize*, if successful.

The *posix\_trace\_attr\_getmaxdatasize*() function stores the maximum trace event record memory size in the object pointed to by *maxdatasize*, if successful.

The *posix\_trace\_attr\_getmaxsystemeventsize*() function stores the maximum memory size to store a single system trace event in the object pointed to by *eventsize*, if successful.

The *posix\_trace\_attr\_getmaxusereventsize*() function stores the maximum memory size to store a single user trace event in the object pointed to by *eventsize*, if successful.

The *posix\_trace\_attr\_getstreamsize*() function stores the maximum trace stream allowed size in the object pointed to by *streamsize*, if successful.

## ERRORS

These functions may fail if:

- **EINVAL**

  The value specified by one of the arguments is invalid.

*The following sections are informative.*

## EXAMPLES

None.

## APPLICATION USAGE

None.

## RATIONALE

None.

## FUTURE DIRECTIONS

The following functions:

```
posix_trace_attr_getlogsize()
posix_trace_attr_getmaxdatasize()
posix_trace_attr_getmaxsystemeventsize()
posix_trace_attr_getmaxusereventsize()
posix_trace_attr_getstreamsize()
posix_trace_attr_setlogsize()
posix_trace_attr_setmaxdatasize()
posix_trace_attr_setstreamsize()
```

may be removed in a future version.

## SEE ALSO

*posix\_trace\_attr\_destroy()*, *posix\_trace\_create()*, *posix\_trace\_event()*, *posix\_trace\_get\_attr()*

The Base Definitions volume of POSIX.1‐2017, ***\<sys\_types.h\>***, ***\<trace.h\>***

## COPYRIGHT

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting\_bugs.html .
