Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_switch_cpu.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2018 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 **********************************************************************
26 *
27 * @filename openapi_switch_cpu.h
28 *
29 * @purpose Switch CPU API
30 *
31 * @component OpEN
32 *
33 * @create 08/31/2018
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_SWITCH_CPU_H_INCLUDED
39 #define OPENAPI_SWITCH_CPU_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 #define OPEN_CPU_UTIL_SCALAR 10000
44 
45 #define OPEN_CPU_TASK_UTIL_SIZE 65
46 
47 /* Header and footer prints */
48 #define OPEN_CPU_TASK_UTIL_HEADER_ROWS 5
49 
50 /* The OPEN_CPU_TASK_COUNT_AVERAGE is used as average task count and is used to
51  * calculate the minimum buffer size required. If the tasks are more, provide
52  * the buffer size calculated with L7_CPU_UTIL_MAX_TASKS. If the tasks are more
53  * than OPEN_CPU_TASK_COUNT_AVERAGE and provided a buffer calculated with
54  * OPEN_CPU_TASK_COUNT_AVERAGE, the provided buffer size will be filled and
55  * skipping the remaining data.
56  */
57 #define OPEN_CPU_TASK_COUNT_AVERAGE 100
58 
60 typedef enum
61 {
68 
69 typedef struct
70 {
71  uint32_t timePeriod;
72  uint32_t utilization;
74 
75 /*****************************************************************/
98  open_buffdesc *data);
99 
100 /*****************************************************************/
115  uint32_t *max);
116 
117 /*************************************************************************/
134  uint32_t *param_val);
135 
136 /*************************************************************************/
153  uint32_t param_val);
154 
155 /*****************************************************************/
175  open_buffdesc *data);
176 #endif /* OPENAPI_SWITCH_CPU_H_INCLUDED */
177 
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.
uint32_t timePeriod
Time period (secs) over which CPU utilization is being measured.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiTotalCpuUtilArrayGet(openapiClientHandle_t *client_handle, open_buffdesc *data)
Get CPU utilization for all tracked periods.
OPEN_CPU_UTIL_MONITOR_PARAMS_t
OPEN cpu threshold param.
open_error_t openapiTaskUtilPrint(openapiClientHandle_t *client_handle, open_buffdesc *data)
Get the task CPU utilization for all tracked periods.
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.
uint32_t utilization
Utilization of the CPU (% * OPEN_CPU_UTIL_SCALAR)
open_error_t openapiCpuUtilMaxPeriodsGet(openapiClientHandle_t *client_handle, uint32_t *max)
Get the maximum number of periods tracked for CPU utilization.