Zephyr Project API 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
CPU load monitor

Module for monitoring CPU Load. More...

Functions

void cpu_load_on_enter_idle (void)
 Hook called by the application specific hook on entering CPU idle.
 
void cpu_load_on_exit_idle (void)
 Hook called by the application specific hook on exiting CPU idle.
 
int cpu_load_get (bool reset)
 Get CPU load.
 
void cpu_load_log_control (bool enable)
 Control periodic CPU statistics report.
 

Detailed Description

Module for monitoring CPU Load.

This module allow monitoring of the CPU load.

Function Documentation

◆ cpu_load_get()

int cpu_load_get ( bool  reset)

#include <include/zephyr/debug/cpu_load.h>

Get CPU load.

CPU load is measured using a timer which tracks amount of time spent in the CPU idle. Since it is a software tracking there is some small overhead. Precision depends on the frequency of the timer in relation to the CPU frequency.

Parameters
resetReset the measurement after reading.
Return values
Positivenumber - CPU load in per mille.
Negativenumber - error code.

◆ cpu_load_log_control()

void cpu_load_log_control ( bool  enable)

#include <include/zephyr/debug/cpu_load.h>

Control periodic CPU statistics report.

Report logging is by default enabled.

Parameters
enabletrue to enable report logging and false to disable.

◆ cpu_load_on_enter_idle()

void cpu_load_on_enter_idle ( void  )

#include <include/zephyr/debug/cpu_load.h>

Hook called by the application specific hook on entering CPU idle.

◆ cpu_load_on_exit_idle()

void cpu_load_on_exit_idle ( void  )

#include <include/zephyr/debug/cpu_load.h>

Hook called by the application specific hook on exiting CPU idle.