oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
thread_state_stats.h File Reference

Per-thread state time tracking. More...

#include <stdint.h>
Include dependency graph for thread_state_stats.h:

Go to the source code of this file.

Data Structures

struct  ove_state_tracker
 Per-thread state-occupancy tracker. More...
 

Macros

#define OVE_STATE_COUNT   5
 

Functions

uint64_t ove_state_stats_now_us (void)
 
static void ove_state_track_init (struct ove_state_tracker *st, int initial_state)
 
static void ove_state_track_transition (struct ove_state_tracker *st, int new_state)
 

Detailed Description

Per-thread state time tracking.

Gated behind CONFIG_OVE_THREAD_STATE_STATS. Each backend embeds an ove_state_tracker in its thread struct and calls ove_state_track_transition() on every state change.

State indices match ove_thread_state_t: 0=RUNNING, 1=READY, 2=BLOCKED, 3=SUSPENDED, 4=TERMINATED

Function Documentation

◆ ove_state_stats_now_us()

uint64_t ove_state_stats_now_us ( void  )

Platform-specific: return monotonic time in microseconds.