• 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 /**
17  * @addtogroup HiAppEvent
18  * @{
19  *
20  * @brief Provides application event logging functions.
21  *
22  * Provides the event logging function for applications to log the fault, statistical, security, and user behavior
23  * events reported during running. Based on event information, you will be able to analyze the running status of
24  * applications.
25  *
26  * @since 8
27  * @version 1.0
28  */
29 
30 /**
31  * @file hiappevent_event.h
32  *
33  * @brief Defines the event names of all predefined events.
34  *
35  * In addition to custom events associated with specific apps, you can also use predefined events for logging.
36  *
37  * Sample code:
38  * <pre>
39  *     ParamList list = OH_HiAppEvent_CreateParamList();
40  *     OH_HiAppEvent_AddInt32Param(list, PARAM_USER_ID, 123);
41  *     int res = OH_HiAppEvent_Write("user_domain", EVENT_USER_LOGIN, BEHAVIOR, list);
42  *     OH_HiAppEvent_DestroyParamList(list);
43  * </pre>
44  *
45  * @kit PerformanceAnalysisKit
46  * @library libhiappevent_ndk.z.so
47  * @syscap SystemCapability.HiviewDFX.HiAppEvent
48  * @since 8
49  * @version 1.0
50  */
51 
52 #ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H
53 #define HIVIEWDFX_HIAPPEVENT_EVENT_H
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 app hicollie event.
157  *
158  * @since 18
159  * @version 1.0
160  */
161 #define EVENT_APP_HICOLLIE "APP_HICOLLIE"
162 
163 /**
164  * @brief app killed event.
165  *
166  * @since 20
167  * @version 1.0
168  */
169 #define EVENT_APP_KILLED "APP_KILLED"
170 
171 /**
172  * @brief OS domain.
173  *
174  * @since 12
175  * @version 1.0
176  */
177 #define DOMAIN_OS "OS"
178 
179 #ifdef __cplusplus
180 }
181 #endif
182 /** @} */
183 #endif // HIVIEWDFX_HIAPPEVENT_EVENT_H