POSIX_TRACE_START(3POSIX)

πŸ’– POSIX_TRACE_START(3POSIX) β€” the POSIX Programmer's Manual πŸ’–

okay bestie, so this one's from the POSIX Programmer's Manual, and the page is called POSIX_TRACE_START(3POSIX). Two functions, one page, and they're literally just "go" and "stop" for your trace stream. Main character energy fr.


🌸 PROLOG 🌸

Real talk before we start: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so like, consult the corresponding Linux manual page for details on Linux behavior β€” or honestly, the interface may not be implemented on Linux at all. πŸ™ˆ So vibe check your platform first, iykyk.


✨ NAME ✨

posix_trace_start, posix_trace_stop β€” trace start and stop (TRACING)


πŸŽ€ SYNOPSIS πŸŽ€

#include <trace.h>

int posix_trace_start(trace_id_t trid);
int posix_trace_stop (trace_id_t trid);

πŸ¦‹ DESCRIPTION πŸ¦‹

So posix_trace_start() and posix_trace_stop() do exactly what it says on the tin, bestie: they shall start and stop the trace stream identified by the argument trid. That's it. That's the whole job. πŸ’…

Now the deets, because the deets are where it gets spicy:

Calling posix_trace_start() β€” its whole effect shall be recorded in the trace stream as the POSIX_TRACE_START system trace event, and the status of the trace stream shall become POSIX_TRACE_RUNNING. 🌈 But here's the tea:

  • If the trace stream is already in progress when you call it, the POSIX_TRACE_START system trace event shall not be recorded, and the trace stream shall just keep on running. It said "I'm already up", no notes. 😭
  • If the trace stream is full, the POSIX_TRACE_START system trace event shall not be recorded, and the status of the trace stream shall not be changed. Nothing happens. Iconic non-event, honestly.

Calling posix_trace_stop() β€” its whole effect shall be recorded in the trace stream as the POSIX_TRACE_STOP system trace event, and the status of the trace stream shall become POSIX_TRACE_SUSPENDED. πŸ’€ Same energy on the edge cases:

  • If the trace stream is already suspended when you call it, the POSIX_TRACE_STOP system trace event shall not be recorded, and the trace stream shall remain suspended. She's resting, leave her alone. 🧚
  • If the trace stream is full, the POSIX_TRACE_STOP system trace event shall not be recorded, and the status of the trace stream shall not be changed.

πŸ’œ RETURN VALUE πŸ’œ

Slay on success: these functions shall return a value of zero. ✨

Otherwise β€” and this is the not-slay part β€” they shall return the corresponding error number.


πŸ”₯ ERRORS πŸ”₯

These functions shall fail if:

  • EINVAL β€” The value of the argument trid does not correspond to an active trace stream, and thus no trace stream was started or stopped. Like, there's nothing there to start or stop, bestie. πŸ’€
  • EINTR β€” The operation was interrupted by a signal, and thus the trace stream was not necessarily started or stopped. Not necessarily!! So don't assume it worked. πŸ™ˆ
Heads up: the following sections are informative. Not the normative stuff, just the vibes.

πŸ“ EXAMPLES πŸ“

None. 🫢 (Not me giving you zero examples. The standard said so, not me.)


🌈 APPLICATION USAGE 🌈

None. πŸ’…


πŸ‘‘ RATIONALE πŸ‘‘

None. ✨


πŸ’€ FUTURE DIRECTIONS πŸ’€

Okay so this is the part where I hold your hand: the posix_trace_start() and posix_trace_stop() functions may be removed in a future version. So don't build your entire personality around them, bestie. 😭


⭐ SEE ALSO ⭐

  • posix_trace_create()
  • 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 .


and that's the whole page, bestie!! πŸ’–βœ¨πŸ¦‹ brought to you by IEEE/The Open Group, dated 2017, and yes the page really is named POSIX_TRACE_START(3POSIX) β€” stan a title that commits. periodt. πŸ‘‘πŸ’…πŸŒΈ