POSIX_T...TLOGSIZE(3POSIX)
π POSIX_T...TLOGSIZE β the POSIX Programmer's Manual one π
okay bestie, welcome to POSIX_T...TLOGSIZE(3POSIX) π¦ this is a page from the POSIX Programmer's Manual, and before we go any further you NEED to know the vibe:
β οΈ 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. π
like. it might not even exist on ur machine. check first, queen. π
β¨ 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) π
it's giving "eight functions, one mission: know how big ur trace buffers are." periodt.
β¨ 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);
look at all those restrict qualifiers bestie, they're serving β¨optimizationβ¨ energy. π₯
β¨ DESCRIPTION β¨
the getters π«Ά
posix_trace_attr_getlogsize() 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. and the default value for the log-max-size attribute? implementation-defined π (i.e. don't @ me, ask ur libc).
posix_trace_attr_getmaxdatasize() 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. default value for the max-data-size attribute is also implementation-defined. classic. π
posix_trace_attr_getmaxsystemeventsize() 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.
posix_trace_attr_getmaxusereventsize() 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.
posix_trace_attr_getstreamsize() 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.
the β¨loreβ¨ about sizes πΈ
okay this next bit is the important part, don't scroll past it:
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. π«‘ no dropped events, no cap.
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. π so don't count ur attribute structs, they're not invited to this party.
the setters π
posix_trace_attr_setlogsize() 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.
posix_trace_attr_setmaxdatasize() 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. π yep, it can just chop ur data. rude but legal.
posix_trace_attr_setstreamsize() 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.
the log-full-policy tea β
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. π« so if u set APPEND and ur log size does nothing, that's not a bug, that's the spec, bestie.
β¨ RETURN VALUE β¨
Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding error number. (no -1, no errno shenanigans, just the number. iconic.) β
and here's what each one drops into ur output variable on success:
- The
posix_trace_attr_getlogsize()function stores the maximum trace log allowed size in the object pointed to bylogsize, if successful. - The
posix_trace_attr_getmaxdatasize()function stores the maximum trace event record memory size in the object pointed to bymaxdatasize, 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 byeventsize, 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 byeventsize, if successful. - The
posix_trace_attr_getstreamsize()function stores the maximum trace stream allowed size in the object pointed to bystreamsize, 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. π not a single example. we're on our own out here, girlies.
β¨ APPLICATION USAGE β¨
None. π
β¨ RATIONALE β¨
None. π§ apparently they didn't feel like explaining themselves.
β¨ 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. ππ girl they're on the chopping block. don't build ur whole career on them, iykyk.
β¨ 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 . π
and that's the whole page, bestie!! π this diva of a manpage was brought to u by IEEE/The Open Group, 2017 β dated 2017 but still serving in 3POSIX, we love a timeless queen. bye pookie, go check ur log sizes ππβ¨
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms