|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

结构体 | |
| struct | tagCpupInfo |
宏定义 | |
| #define | LOS_ERRNO_CPUP_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x00) |
| #define | LOS_ERRNO_CPUP_TASK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x01) |
| #define | LOS_ERRNO_CPUP_NO_INIT LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x02) |
| #define | LOS_ERRNO_CPUP_MAXNUM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x03) |
| #define | LOS_ERRNO_CPUP_THREAD_NO_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x04) |
| #define | LOS_ERRNO_CPUP_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x05) |
类型定义 | |
| typedef struct tagCpupInfo | CPUP_INFO_S |
枚举 | |
| enum | CpupMode { CPUP_LAST_MULIT_RECORD = 0 , CPUP_LAST_ONE_RECORD = 1 , CPUP_ALL_TIME = 0xffff } |
函数 | |
| UINT32 | LOS_HistorySysCpuUsage (UINT32 mode) |
| Obtain the historical CPU usage. | |
| UINT32 | LOS_HistoryTaskCpuUsage (UINT32 taskId, UINT32 mode) |
| Obtain the historical CPU usage of a specified task. | |
| UINT32 | LOS_AllCpuUsage (UINT16 maxNum, CPUP_INFO_S *cpupInfo, UINT32 mode, UINT16 flag) |
| Obtain the CPU usage of tasks and hardware interrupts. | |
| void | LOS_CpupReset (void) |
| Reset the data of CPU usage. | |
| void | LOS_CpupStop (void) |
| Stop LiteOS CPUP module. | |
| void | LOS_CpupStart (void) |
| Start LiteOS CPUP module. | |
| #define LOS_ERRNO_CPUP_MAXNUM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x03) |
CPU usage error code: The number of threads is invalid.
Value: 0x02001e03.
Solution: Check whether the number of threads is applicable for the current operation.
| #define LOS_ERRNO_CPUP_NO_INIT LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x02) |
CPU usage error code: The CPU usage is not initialized.
Value: 0x02001e02.
Solution: Check whether the CPU usage is initialized.
| #define LOS_ERRNO_CPUP_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x00) |
CPU usage error code: The request for memory fails.
Value: 0x02001e00.
Solution: Decrease the maximum number of tasks.
| #define LOS_ERRNO_CPUP_TASK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x01) |
CPU usage error code: The pointer to an input parameter is NULL.
Value: 0x02001e01.
Solution: Check whether the pointer to the input parameter is usable.
| #define LOS_ERRNO_CPUP_THREAD_NO_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x04) |
CPU usage error code: The target thread is not created.
Value: 0x02001e04.
Solution: Check whether the target thread is created.
| #define LOS_ERRNO_CPUP_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x05) |
CPU usage error code: The target task ID is invalid.
Value: 0x02001e05.
Solution: Check whether the target task ID is applicable for the current operation.
| typedef struct tagCpupInfo CPUP_INFO_S |
The structure of the CPU usage information of all tasks.
| enum CpupMode |
The time period which the CPU usage collects in.
|
extern |
Obtain the CPU usage of tasks and hardware interrupts.
| maxNum | [IN] Type UINT16. The Maximum number of tasks or hardware interrupts to be obtained. |
| cpupInfo | [OUT] Type CPUP_INFO_S*. The pointer used to save the CPU usage information. |
| mode | [IN] Type UINT32. Task mode. The parameter value 0 indicates that the CPU usage in the last ten seconds will be obtained, and the parameter value 1 indicates that the CPU usage in the former one second will be obtained. Other values indicate that the CPU usage in all time will be obtained. |
| flag | [IN] Type UINT16. The parameter value 0 indicates that the API only obtains hardware interrupt CPU usage. Other values indicate that the API only obtains the task CPU usage. |
| LOS_ERRNO_CPUP_NO_INIT | The CPU usage is not initialized. |
| LOS_ERRNO_CPUP_TASK_PTR_NULL | The input parameter pointer is NULL. |
| LOS_ERRNO_CPUP_MAXNUM_INVALID | The maximum number of tasks or hardware interrupts is invalid. |
| LOS_OK | The CPU usage is successfully obtained. |
|
extern |
Reset the data of CPU usage.
| None. |
| None. |
|
extern |
Start LiteOS CPUP module.
| None. |
| None. |
|
extern |
Stop LiteOS CPUP module.
| None. |
| None. |
Obtain the historical CPU usage.
| mode | [IN] Type UINT32. Task mode. The parameter value 0 indicates that the CPU usage in the last ten seconds will be obtained, and the parameter value 1 indicates that the CPU usage in the former one second will be obtained. Other values indicate that the CPU usage in all time will be obtained. |
| LOS_ERRNO_CPUP_NO_INIT | The CPU usage is not initialized. |
| UINT32 | The historical CPU usage of the system. It is a permillage. And the value range is [0,1000]. |
Obtain the historical CPU usage of a specified task.
| taskId | [IN] Type UINT32. Task ID. |
| mode | [IN] Type UINT32. Task mode. The parameter value 0 indicates that the CPU usage in the last ten seconds will be obtained, and the parameter value 1 indicates that the CPU usage in the former one second will be obtained. Other values indicate that the CPU usage in all time will be obtained. |
| LOS_ERRNO_CPUP_NO_INIT | The CPU usage has not been initialized. |
| LOS_ERRNO_CPUP_TSK_ID_INVALID | The passed-in task ID is invalid. |
| LOS_ERRNO_CPUP_THREAD_NO_CREATED | The task specified by the task ID has not been created. |
| UINT32 | The historical CPU usage of a specified task. It is a permillage. And the value range is [0,1000]. |