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  * @syscap SystemCapability.HiviewDFX.HiAppEvent
30  *
31  * @since 8
32  * @version 1.0
33  */
34 
35 /**
36  * @file hiappevent_event.h
37  *
38  * @brief Defines the event names of all predefined events.
39  *
40  * In addition to custom events associated with specific apps, you can also use predefined events for logging.
41  *
42  * Sample code:
43  * <pre>
44  *     ParamList list = OH_HiAppEvent_CreateParamList();
45  *     OH_HiAppEvent_AddInt32Param(list, PARAM_USER_ID, 123);
46  *     int res = OH_HiAppEvent_Write("user_domain", EVENT_USER_LOGIN, BEHAVIOR, list);
47  *     OH_HiAppEvent_DestroyParamList(list);
48  * </pre>
49  *
50  * @since 8
51  * @version 1.0
52  */
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /**
59  * @brief user login event.
60  *
61  * @since 8
62  * @version 1.0
63  */
64 #define EVENT_USER_LOGIN "hiappevent.user_login"
65 
66 /**
67  * @brief user logout event.
68  *
69  * @since 8
70  * @version 1.0
71  */
72 #define EVENT_USER_LOGOUT "hiappevent.user_logout"
73 
74 /**
75  * @brief distributed service event.
76  *
77  * @since 8
78  * @version 1.0
79  */
80 #define EVENT_DISTRIBUTED_SERVICE_START "hiappevent.distributed_service_start"
81 
82 /**
83  * @brief app crash event.
84  *
85  * @since 12
86  * @version 1.0
87  */
88 #define EVENT_APP_CRASH "APP_CRASH"
89 
90 /**
91  * @brief app freeze event.
92  *
93  * @since 12
94  * @version 1.0
95  */
96 #define EVENT_APP_FREEZE "APP_FREEZE"
97 
98 /**
99  * @brief app launch event.
100  *
101  * @since 12
102  * @version 1.0
103  */
104 #define EVENT_APP_LAUNCH "APP_LAUNCH"
105 
106 /**
107  * @brief app scroll jank event.
108  *
109  * @since 12
110  * @version 1.0
111  */
112 #define EVENT_SCROLL_JANK "SCROLL_JANK"
113 
114 /**
115  * @brief app cpu usage high event.
116  *
117  * @since 12
118  * @version 1.0
119  */
120 #define EVENT_CPU_USAGE_HIGH "CPU_USAGE_HIGH"
121 
122 /**
123  * @brief app battery usage event.
124  *
125  * @since 12
126  * @version 1.0
127  */
128 #define EVENT_BATTERY_USAGE "BATTERY_USAGE"
129 
130 /**
131  * @brief app resource overlimit event.
132  *
133  * @since 12
134  * @version 1.0
135  */
136 #define EVENT_RESOURCE_OVERLIMIT "RESOURCE_OVERLIMIT"
137 
138 /**
139  * @brief app address sanitizer event.
140  *
141  * @since 12
142  * @version 1.0
143  */
144 #define EVENT_ADDRESS_SANITIZER "ADDRESS_SANITIZER"
145 
146 /**
147  * @brief app main thread jank event.
148  *
149  * @since 12
150  * @version 1.0
151  */
152 #define EVENT_MAIN_THREAD_JANK "MAIN_THREAD_JANK"
153 
154 /**
155  * @brief OS domain.
156  *
157  * @since 12
158  * @version 1.0
159  */
160 #define DOMAIN_OS "OS"
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 /** @} */
166 #endif // HIVIEWDFX_HIAPPEVENT_EVENT_H