Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
Data Structures | Macros | Enumerations | Functions
Switch CPU API [OPENAPI_SWITCH_CPU]

Data Structures

struct  OPEN_CPU_PERIOD_UTIL_INFO_t
 

Macros

#define OPEN_CPU_TASK_COUNT_AVERAGE   100
 
#define OPEN_CPU_TASK_UTIL_HEADER_ROWS   5
 
#define OPEN_CPU_TASK_UTIL_SIZE   65
 
#define OPEN_CPU_UTIL_SCALAR   10000
 

Enumerations

enum  OPEN_CPU_UTIL_MONITOR_PARAMS_t {
  OPEN_CPU_UTIL_MONITOR_RISING_THRESHOLD_PARAM = 0, OPEN_CPU_UTIL_MONITOR_RISING_PERIOD_PARAM = 1, OPEN_CPU_UTIL_MONITOR_FALLING_THRESHOLD_PARAM = 2, OPEN_CPU_UTIL_MONITOR_FALLING_PERIOD_PARAM = 3,
  OPEN_CPU_UTIL_MONITOR_LAST_PARAM = 4
}
 OPEN cpu threshold param. More...
 

Functions

open_error_t openapiCpuUtilMaxPeriodsGet (openapiClientHandle_t *client_handle, uint32_t *max)
 Get the maximum number of periods tracked for CPU utilization. More...
 
open_error_t openapiCpuUtilMonitorParamGet (openapiClientHandle_t *client_handle, OPEN_CPU_UTIL_MONITOR_PARAMS_t param_Type, uint32_t *param_val)
 Get a CPU utilization monitoring parameter. More...
 
open_error_t openapiCpuUtilMonitorParamSet (openapiClientHandle_t *client_handle, OPEN_CPU_UTIL_MONITOR_PARAMS_t param_Type, uint32_t param_val)
 Set a CPU utilization monitoring parameter. More...
 
open_error_t openapiTaskUtilPrint (openapiClientHandle_t *client_handle, open_buffdesc *data)
 Get the task CPU utilization for all tracked periods. More...
 
open_error_t openapiTotalCpuUtilArrayGet (openapiClientHandle_t *client_handle, open_buffdesc *data)
 Get CPU utilization for all tracked periods. More...
 

Detailed Description

Enumeration Type Documentation

OPEN cpu threshold param.

Enumerator
OPEN_CPU_UTIL_MONITOR_RISING_THRESHOLD_PARAM 

Rising threshold.

OPEN_CPU_UTIL_MONITOR_RISING_PERIOD_PARAM 

Rising period.

OPEN_CPU_UTIL_MONITOR_FALLING_THRESHOLD_PARAM 

Falling threshold.

OPEN_CPU_UTIL_MONITOR_FALLING_PERIOD_PARAM 

Falling period.

OPEN_CPU_UTIL_MONITOR_LAST_PARAM 

Last one.

Definition at line 60 of file openapi_switch_cpu.h.

Function Documentation

open_error_t openapiCpuUtilMaxPeriodsGet ( openapiClientHandle_t client_handle,
uint32_t *  max 
)

Get the maximum number of periods tracked for CPU utilization.

Parameters
[in]client_handleClient handle from registration API
[out]maxMaximum number of tracked CPU utilization periods.
Return values
OPEN_E_NONEoperation was successful.
OPEN_E_PARAMan invalid parameter was passed.

OpEN API Version: 1.18

Examples:
switch_cpu_example.c.
open_error_t openapiCpuUtilMonitorParamGet ( openapiClientHandle_t client_handle,
OPEN_CPU_UTIL_MONITOR_PARAMS_t  param_Type,
uint32_t *  param_val 
)

Get a CPU utilization monitoring parameter.

Parameters
[in]client_handleClient handle from registration API
[in]param_TypeParameter type
[out]param_valValue of the parameter
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
switch_cpu_example.c.
open_error_t openapiCpuUtilMonitorParamSet ( openapiClientHandle_t client_handle,
OPEN_CPU_UTIL_MONITOR_PARAMS_t  param_Type,
uint32_t  param_val 
)

Set a CPU utilization monitoring parameter.

Parameters
[in]client_handleClient handle from registration API
[in]param_TypeParameter type
[in]param_valValue of the parameter
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
switch_cpu_example.c.
open_error_t openapiTaskUtilPrint ( openapiClientHandle_t client_handle,
open_buffdesc data 
)

Get the task CPU utilization for all tracked periods.

Parameters
[in]client_handleClient handle from registration API
[out]dataTask CPU Utilization data.
Return values
OPEN_E_NONEoperation was successful.
OPEN_E_FAILa failure occurred.
OPEN_E_PARAMan invalid parameter was passed.
Note
Minimum number of bytes in data buffer is found by multiplying (OPEN_CPU_TASK_COUNT_AVERAGE + OPEN_CPU_TASK_UTIL_HEADER_ROWS (header and footer rows)) with single task print size OPEN_CPU_TASK_UTIL_SIZE.

OpEN API Version: 1.25

Examples:
switch_cpu_example.c.
open_error_t openapiTotalCpuUtilArrayGet ( openapiClientHandle_t client_handle,
open_buffdesc data 
)

Get CPU utilization for all tracked periods.

Parameters
[in]client_handleClient handle from registration API
[out]dataCPU Utilization data.
Return values
OPEN_E_NONEoperation was successful.
OPEN_E_FAILa failure occurred.
OPEN_E_PARAMan invalid parameter was passed.
Note
Minimum number of bytes in data buffer is found by calling openapiCpuUtilMaxPeriodsGet() and multiplying the result by sizeof(OPEN_CPU_PERIOD_UTIL_INFO_t).
Values in the utilization field of OPEN_CPU_PERIOD_UTIL_INFO_t are floating point scaled by OPEN_CPU_UTIL_SCALAR and represented as unsigned integer values. For example, 15.4567% will be represented as 154567.

OpEN API Version: 1.18

Examples:
switch_cpu_example.c.