µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::rtos::scheduler::statistics Namespace Reference

Scheduler statistics. More...

Functions

void clear (void)
 
rtos::statistics::counter_t context_switches (void)
 Get the total number of context switches.
 
rtos::statistics::duration_t cpu_cycles (void)
 Get the total duration of all threads.
 

Detailed Description

Scheduler statistics.

Function Documentation

◆ clear()

void os::rtos::scheduler::statistics::clear ( void  )
inline

This function sets all statistic counters to zero.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES or OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES is/are defined.
Can be invoked from Interrupt Service Routines.

Definition at line 1082 of file os-sched.h.

◆ context_switches()

rtos::statistics::counter_t os::rtos::scheduler::statistics::context_switches ( void  )
inline

Get the total number of context switches.

Returns
Integer with the total number of context switches since scheduler start.

Each time the scheduler performs a context switch, it increments the thread counter and the scheduler total counter.

This value can be used together with the corresponding thread function, to compute percentages.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES is defined.
Can be invoked from Interrupt Service Routines.

Definition at line 1034 of file os-sched.h.

◆ cpu_cycles()

rtos::statistics::duration_t os::rtos::scheduler::statistics::cpu_cycles ( void  )
inline

Get the total duration of all threads.

Returns
Integer with the number of CPU cycles, possibly divided by some prescaller.

For Cortex-M ports, this value is usually derived from the clock that drives the SysTick, which most of the times is the system clock.

This value can be used together with the corresponding thread function, to compute percentages.

Note
This function is available only when OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES is defined.
Can be invoked from Interrupt Service Routines.

Definition at line 1059 of file os-sched.h.