• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H
17 #define HIVIEWDFX_HIAPPEVENT_EVENT_H
18 
19 /**
20  * @addtogroup HiAppEvent
21  * @{
22  *
23  * @brief Provides application event logging functions.
24  *
25  * Provides the event logging function for applications to log the fault, statistical, security, and user behavior
26  * events reported during running. Based on event information, you will be able to analyze the running status of
27  * applications.
28  *
29  * @kit PerformanceAnalysisKit
30  * @syscap SystemCapability.HiviewDFX.HiAppEvent
31  *
32  * @since 8
33  * @version 1.0
34  */
35 
36 /**
37  * @file hiappevent_event.h
38  *
39  * @brief Defines the event names of all predefined events.
40  *
41  * In addition to custom events associated with specific apps, you can also use predefined events for logging.
42  *
43  * Sample code:
44  * <pre>
45  *     ParamList list = OH_HiAppEvent_CreateParamList();
46  *     OH_HiAppEvent_AddInt32Param(list, PARAM_USER_ID, 123);
47  *     int res = OH_HiAppEvent_Write("user_domain", EVENT_USER_LOGIN, BEHAVIOR, list);
48  *     OH_HiAppEvent_DestroyParamList(list);
49  * </pre>
50  *
51  * @since 8
52  * @version 1.0
53  */
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /**
60  * @brief user login event.
61  *
62  * @since 8
63  * @version 1.0
64  */
65 #define EVENT_USER_LOGIN "hiappevent.user_login"
66 
67 /**
68  * @brief user logout event.
69  *
70  * @since 8
71  * @version 1.0
72  */
73 #define EVENT_USER_LOGOUT "hiappevent.user_logout"
74 
75 /**
76  * @brief distributed service event.
77  *
78  * @since 8
79  * @version 1.0
80  */
81 #define EVENT_DISTRIBUTED_SERVICE_START "hiappevent.distributed_service_start"
82 
83 /**
84  * @brief app crash event.
85  *
86  * @since 12
87  * @version 1.0
88  */
89 #define EVENT_APP_CRASH "APP_CRASH"
90 
91 /**
92  * @brief app freeze event.
93  *
94  * @since 12
95  * @version 1.0
96  */
97 #define EVENT_APP_FREEZE "APP_FREEZE"
98 
99 /**
100  * @brief app launch event.
101  *
102  * @since 12
103  * @version 1.0
104  */
105 #define EVENT_APP_LAUNCH "APP_LAUNCH"
106 
107 /**
108  * @brief app scroll jank event.
109  *
110  * @since 12
111  * @version 1.0
112  */
113 #define EVENT_SCROLL_JANK "SCROLL_JANK"
114 
115 /**
116  * @brief app cpu usage high event.
117  *
118  * @since 12
119  * @version 1.0
120  */
121 #define EVENT_CPU_USAGE_HIGH "CPU_USAGE_HIGH"
122 
123 /**
124  * @brief app battery usage event.
125  *
126  * @since 12
127  * @version 1.0
128  */
129 #define EVENT_BATTERY_USAGE "BATTERY_USAGE"
130 
131 /**
132  * @brief app resource overlimit event.
133  *
134  * @since 12
135  * @version 1.0
136  */
137 #define EVENT_RESOURCE_OVERLIMIT "RESOURCE_OVERLIMIT"
138 
139 /**
140  * @brief app address sanitizer event.
141  *
142  * @since 12
143  * @version 1.0
144  */
145 #define EVENT_ADDRESS_SANITIZER "ADDRESS_SANITIZER"
146 
147 /**
148  * @brief app main thread jank event.
149  *
150  * @since 12
151  * @version 1.0
152  */
153 #define EVENT_MAIN_THREAD_JANK "MAIN_THREAD_JANK"
154 
155 /**
156  * @brief OS domain.
157  *
158  * @since 12
159  * @version 1.0
160  */
161 #define DOMAIN_OS "OS"
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 /** @} */
167 #endif // HIVIEWDFX_HIAPPEVENT_EVENT_H