WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_cpup.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2020. All rights reserved.
3 * Description : LiteOS Cpu Usage Calculation Module Headfile For User
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
34#ifndef _LOS_CPUP_H
35#define _LOS_CPUP_H
36
37#include "los_hwi.h"
38#include "los_base.h"
39#include "los_sys.h"
40#include "los_task.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
54#define LOS_ERRNO_CPUP_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x00)
55
64#define LOS_ERRNO_CPUP_TASK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x01)
65
74#define LOS_ERRNO_CPUP_NO_INIT LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x02)
75
84#define LOS_ERRNO_CPUP_MAXNUM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x03)
85
94#define LOS_ERRNO_CPUP_THREAD_NO_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x04)
95
104#define LOS_ERRNO_CPUP_TSK_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_CPUP, 0x05)
105
114
124
125#define CPUP_LAST_TEN_SECONDS CPUP_LAST_MULIT_RECORD
126#define CPUP_LAST_ONE_SECONDS CPUP_LAST_ONE_RECORD
153
186
227extern UINT32 LOS_AllCpuUsage(UINT16 maxNum, CPUP_INFO_S *cpupInfo, UINT32 mode, UINT16 flag);
228
248
271
296
297#ifdef __cplusplus
298}
299#endif /* __cplusplus */
300
301#endif /* _LOS_CPUP_H */
void LOS_CpupStart(void)
Start LiteOS CPUP module.
CpupMode
Definition los_cpup.h:119
UINT32 LOS_HistorySysCpuUsage(UINT32 mode)
Obtain the historical CPU usage.
void LOS_CpupReset(void)
Reset the data of CPU usage.
UINT32 LOS_AllCpuUsage(UINT16 maxNum, CPUP_INFO_S *cpupInfo, UINT32 mode, UINT16 flag)
Obtain the CPU usage of tasks and hardware interrupts.
void LOS_CpupStop(void)
Stop LiteOS CPUP module.
struct tagCpupInfo CPUP_INFO_S
UINT32 LOS_HistoryTaskCpuUsage(UINT32 taskId, UINT32 mode)
Obtain the historical CPU usage of a specified task.
@ CPUP_ALL_TIME
Definition los_cpup.h:122
@ CPUP_LAST_MULIT_RECORD
Definition los_cpup.h:120
@ CPUP_LAST_ONE_RECORD
Definition los_cpup.h:121
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned int UINT32
Definition los_typedef.h:52
Definition los_cpup.h:110
UINT16 usStatus
Definition los_cpup.h:111
UINT32 uwUsage
Definition los_cpup.h:112