|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Thread-state / sync-primitive trace stream. More...
#include <stdint.h>#include "ove_config.h"
Go to the source code of this file.
Macros | |
| #define | OVE_TRACE_MARK(thread, prim, act, obj) ove_trace_emit_mark((uintptr_t)(thread), (prim), (act), (uintptr_t)(obj)) |
| #define | OVE_TRACE_MARK_CURRENT(prim, act, obj) ove_trace_emit_mark(ove_backend_thread_current_handle(), (prim), (act), (uintptr_t)(obj)) |
Functions | |
| void | ove_trace_emit_state (uintptr_t thread_handle, int old_state, int new_state) |
| Emit a thread state transition. | |
| void | ove_trace_emit_mark (uintptr_t thread_handle, uint8_t prim, uint8_t act, uintptr_t object) |
| Emit a sync-primitive marker. | |
| uintptr_t | ove_backend_thread_current_handle (void) |
| Return the current thread's stable handle, or 0 if none. | |
Thread-state / sync-primitive trace stream.
When CONFIG_OVE_TRACE_STREAM is enabled, every thread state transition is pushed into a lock-free ring and drained by the sim transport, which forwards it to the dashboard as a swimlane. CONFIG_OVE_TRACE_MARKERS additionally emits point markers at sync-primitive entry/exit.
Thread identity is the low 32 bits of the backend thread handle. The dashboard resolves these to names via descriptor records emitted periodically by the sim plugin.
| void ove_trace_emit_state | ( | uintptr_t | thread_handle, |
| int | old_state, | ||
| int | new_state | ||
| ) |
Emit a thread state transition.
Called from backend thread code that already knows the current thread handle.
| [in] | thread_handle | Stable backend handle of the thread changing state. |
| [in] | old_state | Previous state, using the ove_thread_state_t encoding. |
| [in] | new_state | New state, using the ove_thread_state_t encoding. |
| void ove_trace_emit_mark | ( | uintptr_t | thread_handle, |
| uint8_t | prim, | ||
| uint8_t | act, | ||
| uintptr_t | object | ||
| ) |
Emit a sync-primitive marker.
| [in] | thread_handle | Stable backend handle of the emitting thread. |
| [in] | prim | One of OVE_TRACE_PRIM_*. |
| [in] | act | One of OVE_TRACE_ACT_*. |
| [in] | object | Address of the primitive (low 16 bits survive into the record). |
| uintptr_t ove_backend_thread_current_handle | ( | void | ) |
Return the current thread's stable handle, or 0 if none.
Supplied by the thread backend (posix_thread.c, wasm_thread.c). Used by OVE_TRACE_MARK_CURRENT to tag markers emitted from sync-primitive code that doesn't otherwise have the thread pointer in scope.