Skip to main content

Module trace_marker

Module trace_marker 

Source
Expand description

Application trace markers: one (marker_id, arg) event that the APPLICATION places, emitted through the same installed sink the executor’s own callback events go to.

The id space is shared with the executor’s events, so the application gets a reserved block of its own:

idsowner
0reserved: what a zeroed id reads as; never emitted
1 ..= 15the APPLICATION (APP_MARKER_FIRST..=APP_MARKER_LAST)
16 and upthe executor (16-27 today; the block grows upward)

An id outside the application block is REFUSED, never clamped: a clamped id would land on another marker’s meaning, and a capture with confidently wrong labels is worse than one with a gap.

The range check and the error type are ungated, so a caller needs no cfg and an image built without callback tracing still validates its ids. The emission itself only happens with the trace-callbacks feature and an installed sink. With no sink installed, emit_app_marker costs the range compare, one atomic load and one branch; without the feature, the range compare alone.

Structs§

AppMarkerIdOutOfRange
An application marker id outside APP_MARKER_FIRST..=APP_MARKER_LAST. Carries the refused id.

Constants§

APP_MARKER_FIRST
First application marker id.
APP_MARKER_LAST
Last application marker id. Ids from 16 up belong to the executor.

Functions§

emit_app_marker
Emit one application event (id, arg) through the installed trace sink.
is_app_marker
Whether id is an application marker id.