WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
perf_pmu_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3 * Description: LiteOS Perf Pmu Manager Implementation Private HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2020-07-29
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
29#ifndef _PERF_PMU_PRI_H
30#define _PERF_PMU_PRI_H
31
32#include "los_perf_pri.h"
33
34#ifdef LOSCFG_COMPAT_LINUX_HRTIMER
35#include "linux/hrtimer.h"
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif /* __cplusplus */
41
42typedef struct {
46 VOID (*enable)(Event *event);
47 VOID (*disable)(Event *event);
48 VOID (*start)(VOID);
49 VOID (*stop)(VOID);
50 VOID (*clear)(VOID);
51 VOID (*setPeriod)(Event *event);
52 UINTPTR (*readCnt)(Event *event);
53 UINT32 (*mapEvent)(UINT32 eventType, UINT32 *result, UINT32 len, BOOL reverse);
54} HwPmu;
55
56typedef struct {
58 union {
59 struct { /* trace event */
61 };
62#ifdef LOSCFG_COMPAT_LINUX_HRTIMER
63 struct { /* timer event */
64 struct hrtimer hrtimer;
65 union ktime time;
66 union ktime cfgTime;
67 };
68#endif
69 };
70} SwPmu;
71
72#define GET_HW_PMU(item) LOS_DL_LIST_ENTRY(item, HwPmu, pmu)
73
74#define TIMER_PERIOD_LOWER_BOUND_US 100
75
76#define PERF_HW_INVALID_EVENT_TYPE 0xFFFFFFFF
77
78#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
79
80#define PMU_LABEL_INT_1 \
81 NUM_HAL_INTERRUPT_PMU_0,
82#define PMU_LABEL_INT_2 \
83 PMU_LABEL_INT_1 \
84 NUM_HAL_INTERRUPT_PMU_1,
85#define PMU_LABEL_INT_3 \
86 PMU_LABEL_INT_2 \
87 NUM_HAL_INTERRUPT_PMU_2,
88#define PMU_LABEL_INT_4 \
89 PMU_LABEL_INT_3 \
90 NUM_HAL_INTERRUPT_PMU_3,
91
92#define PMU_INT(num) PMU_LABEL_INT_##num
93
94#define OS_PMU_INTS(num, pmuInts) \
95 STATIC const UINT32 pmuInts[num] = { \
96 PMU_INT(num) \
97 }
98
102
109
113extern UINT32 OsPerfHwInit(HwPmu *hwPmu);
114extern VOID OsPerfHwDeinit(HwPmu *hwPmu);
116
117#ifdef __cplusplus
118}
119#endif /* __cplusplus */
120
121#endif /* _PERF_PMU_PRI_H */
#define LOSCFG_KERNEL_CORE_NUM
Definition los_config.h:258
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
size_t BOOL
Definition los_typedef.h:83
osal_u8 type
Definition oal_net.h:0
VOID OsSwPmuDeinit(VOID)
Pmu * OsPerfPmuGet(UINT32 type)
VOID OsTimedPmuDeinit(VOID)
UINT32 OsPerfPmuRegister(Pmu *pmu)
UINT32 OsGetPmuMaxCounter(VOID)
UINT32 OsPerfHwInit(HwPmu *hwPmu)
UINT32 OsGetPmuCounter0(VOID)
VOID OsPerfHwDeinit(HwPmu *hwPmu)
VOID OsPerfHwPmuHandleOverflow(Event *event, PerfRegs *regs)
VOID OsHwPmuDeinit(VOID)
UINT32 OsGetPmuCycleCounter(VOID)
UINT32 OsSwPmuInit(VOID)
UINT32 OsTimedPmuInit(VOID)
VOID OsPerfPmuRm(UINT32 type)
UINT32 OsHwPmuInit(VOID)
Definition los_perf_pri.h:82
Definition perf_pmu_pri.h:42
BOOL canDivided
Definition perf_pmu_pri.h:44
UINT32 cntDivided
Definition perf_pmu_pri.h:45
Pmu pmu
Definition perf_pmu_pri.h:43
Definition los_perf_pri.h:54
Definition los_perf_pri.h:99
Definition perf_pmu_pri.h:56
Pmu pmu
Definition perf_pmu_pri.h:57