POSIX_T...ID_EQUAL(3POSIX)

πŸ’– posix_trace_eventid_equal, posix_trace_eventid_get_name, posix_trace_trid_eventid_open πŸ’–

okay bestie, so this is a page from the POSIX Programmer's Manual β€” yeah, the whole POSIX Programmer's Manual, we're fancy now. πŸŽ€

⚠️ heads up: the Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not even be implemented on Linux at all. no cap.

✨ 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_eventid_equal, posix_trace_eventid_get_name, posix_trace_trid_eventid_open β€” manipulating the trace event type identifier, which is a TRACING thing, iykyk πŸ¦‹


✨ SYNOPSIS ✨

okay so here's the vibe, literally just this:

#include <trace.h>

int posix_trace_eventid_equal(trace_id_t trid, trace_event_id_t event1,
    trace_event_id_t event2);
int posix_trace_eventid_get_name(trace_id_t trid,
    trace_event_id_t event, char *event_name);
int posix_trace_trid_eventid_open(trace_id_t trid,
    const char *restrict event_name,
    trace_event_id_t *restrict event);

πŸ’… DESCRIPTION πŸ’…

posix_trace_eventid_equal()

So this one compares the trace event type identifiers event1 and event2 β€” and they gotta be from the same trace stream or the same trace log, the one identified by the trid argument. periodt.

🚨 but if event1 and event2 are from different trace streams? the return value shall be unspecified. we don't make the rules bestie.

posix_trace_eventid_get_name()

This one returns, in the argument pointed to by event_name, the trace event name associated with the trace event type identifier identified by the argument event β€” for the trace stream, or for the trace log, identified by the trid argument. 🫢

The name of the trace event shall have a maximum of {TRACE_EVENT_NAME_MAX} characters (which has the minimum value {_POSIX_TRACE_EVENT_NAME_MAX}). and like β€” successive calls to this function with the same trace event type identifier and the same trace stream identifier shall return the same event name. consistency queen πŸ‘‘

posix_trace_trid_eventid_open()

This one shall associate a user trace event name with a trace event type identifier for a given trace stream. the trace stream is identified by the trid argument, and it shall be an active trace stream, no sleeping on the job. 😀

The trace event name is the string pointed to by the argument event_name. It shall have a maximum of {TRACE_EVENT_NAME_MAX} characters (which has the minimum value {_POSIX_TRACE_EVENT_NAME_MAX}).

The number of user trace event type identifiers that can be defined for any given process is limited by the maximum value {TRACE_USER_EVENT_MAX}, which has the minimum value {_POSIX_TRACE_USER_EVENT_MAX}.

πŸ¦‹ if the Trace Inherit option is NOT supported

posix_trace_trid_eventid_open() shall associate the user trace event name pointed to by the event_name argument with a trace event type identifier that is unique for the process being traced in the trace stream identified by the trid argument, and it's returned in the variable pointed to by the event argument.

If the user trace event name has already been mapped for the traced process, then the previously assigned trace event type identifier shall be returned. ♻️

If the per-process user trace event name limit represented by {TRACE_USER_EVENT_MAX} has been reached, the pre-defined POSIX_TRACE_UNNAMED_USEREVENT (see Table 2-7, Trace Option: User Trace Event) user trace event shall be returned.

🌈 if the Trace Inherit option IS supported

posix_trace_trid_eventid_open() shall associate the user trace event name pointed to by the event_name argument with a trace event type identifier that is unique for all the processes being traced in the trace stream identified by the trid argument, and it's returned in the variable pointed to by the event argument.

If the user trace event name has already been mapped for the traced processes, then the previously assigned trace event type identifier shall be returned. ♻️

If the per-process user trace event name limit represented by {TRACE_USER_EVENT_MAX} has been reached, the pre-defined POSIX_TRACE_UNNAMED_USEREVENT (see Table 2-7, Trace Option: User Trace Event) user trace event shall be returned.


πŸ”₯ RETURN VALUE πŸ”₯

Upon successful completion, the posix_trace_eventid_get_name() and posix_trace_trid_eventid_open() functions shall return a value of zero. Otherwise, they shall return the corresponding error number. (we love a clean zero ✨)

The posix_trace_eventid_equal() function shall return a non-zero value if event1 and event2 are equal; otherwise, a value of zero shall be returned. No errors are defined. 😌

🚨 but if either event1 or event2 are not valid trace event type identifiers for the trace stream specified by trid, or if the trid is invalid, the behavior shall be unspecified. so like… don't.

The posix_trace_eventid_get_name() function stores the trace event name value in the object pointed to by event_name, if successful. πŸ’–

The posix_trace_trid_eventid_open() function stores the trace event type identifier value in the object pointed to by event, if successful. πŸ’–


πŸ’€ ERRORS πŸ’€

The posix_trace_eventid_get_name() and posix_trace_trid_eventid_open() functions shall fail if:

  • EINVAL β€” The trid argument was not a valid trace stream identifier. 😭

The posix_trace_trid_eventid_open() function shall fail if:

  • ENAMETOOLONG β€” The size of the name pointed to by the event_name argument was longer than the implementation-defined value {TRACE_EVENT_NAME_MAX}. that name was doing too much fr fr πŸ™ˆ

The posix_trace_eventid_get_name() function shall fail if:

  • EINVAL β€” The trace event type identifier event was not associated with any name. nameless… it's giving mysterious πŸ‘»
πŸ“Œ The following sections are informative.

🌟 EXAMPLES 🌟

None. (yes bestie, that's literally it πŸ’€)


πŸŽ€ APPLICATION USAGE πŸŽ€

None. (same energy, nothing here 🫢)


🧚 RATIONALE 🧚

None. (the rationale said "no thoughts, head empty" 😭)


⭐ FUTURE DIRECTIONS ⭐

The posix_trace_eventid_equal(), posix_trace_eventid_get_name(), and posix_trace_trid_eventid_open() functions may be removed in a future version. so like… enjoy them while they're here πŸ’”


πŸ‘‘ SEE ALSO πŸ‘‘

  • Table 2-7, Trace Option: User Trace Event
  • exec
  • posix_trace_event()
  • posix_trace_getnext_event()

and from The Base Definitions volume of POSIX.1‐2017: <trace.h> 🌈


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 .


okay that's the whole page bestie, ily, go forth and trace responsibly πŸ’…βœ¨ β€” this was brought to you by IEEE/The Open Group, dated 2017, filed under POSIX_T...ID_EQUAL(3POSIX) πŸ¦‹πŸŒΈ