PDK API Guide for J721E
LoadP

Introduction

LoadP interface

Files

file  LoadP.h
 Load module to measure CPU Load and Task Load for the RTOS Porting Interface.
 

Data Structures

struct  LoadP_Stats
 Load statistics info. More...
 

Functions

void LoadP_reset (void)
 Function to Reset load statistics. More...
 
LoadP_Status LoadP_getTaskLoad (TaskP_Handle taskHandle, LoadP_Stats *stats)
 Function to get task load statistics. More...
 
uint32_t LoadP_getCPULoad (void)
 Function to get CPU load in percentage. More...
 
void LoadP_update (void)
 Update load statistics. More...
 

Enumerations

enum  LoadP_Status { LoadP_OK = 0, LoadP_FAILURE = (-(int32_t)1) }
 Status codes for LoadP APIs. More...
 

Enumeration Type Documentation

◆ LoadP_Status

Status codes for LoadP APIs.

Enumerator
LoadP_OK 

API completed successfully

LoadP_FAILURE 

API failed

Function Documentation

◆ LoadP_reset()

void LoadP_reset ( void  )

Function to Reset load statistics.

    Until load statistics is reset the load statistics keep getting accumulated.

◆ LoadP_getTaskLoad()

LoadP_Status LoadP_getTaskLoad ( TaskP_Handle  taskHandle,
LoadP_Stats stats 
)

Function to get task load statistics.

Parameters
taskHandle[in] A TaskP_Handle returned from TaskP_create
stats[out] Returned Task Load stats
Returns
Status of the function
  • LoadP_OK: LoadP_Stats populated with the task load statistics
  • LoadP_FAILURE: Failed to populate LoadP_Stats with the task load statistics

◆ LoadP_getCPULoad()

uint32_t LoadP_getCPULoad ( void  )

Function to get CPU load in percentage.

Returns
CPU load in percentage

◆ LoadP_update()

void LoadP_update ( void  )

Update load statistics.

    This updates task load statistics for all tasks created with TaskP_create().
    Also updates idle task load/CPU Load.

    This function is called, every "configLOAD_WINDOW_IN_MS" msecs within the IDLE task.
    It is important that idle task get to run atleast once every "configLOAD_WINDOW_IN_MS" msecs
    for the load statistics to be correct

    In case of FreeRTOS, FreeRTOSConfig.h enables update in idle
    and idle task calls this API.
    FreeRTOSConfig.h:-

        #define configLOAD_UPDATE_IN_IDLE   (1)
        #define configLOAD_WINDOW_IN_MS     (500)