From 89673a1f0f22094b657c06e11c8d3f38edaa238c Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Wed, 21 Feb 2024 10:45:57 +0800 Subject: [PATCH 1/5] update hiviewdfx/hiappevent/include/hiappevent/hiappevent.h. Signed-off-by: yuhaoqiang --- .../include/hiappevent/hiappevent.h | 204 ++++++++++++++++++ .../include/hiappevent/hiappevent_event.h | 64 ++++++ 2 files changed, 268 insertions(+) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index 2b3d36311..e967770a3 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -107,6 +107,40 @@ enum EventType { BEHAVIOR = 4 }; +/** + * @brief Definition of HiAppEvent_AppEventInfo object. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @since 12 + * @version 1.0 + */ +struct HiAppEvent_AppEventInfo { + /* The domain of the event. */ + const char* domain; + /* The name of the event. */ + const char* name; + /* The type of the event. */ + enum EventType type; + /* The json string of the parameter. */ + const char* params; +}; + +/** + * @brief Defines the event group. + * + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @since 12 + * @version 1.0 + */ +struct HiAppEvent_AppEventGroup { + /* The name of the event. */ + const char* name; + /* The event array which is group by the name. */ + const struct HiAppEvent_AppEventInfo* appEventInfos; + /* The length of appEventInfos array. */ + uint32_t infoLen; +}; + /** * @brief Event param list node. * @@ -115,6 +149,50 @@ enum EventType { */ typedef struct ParamListNode* ParamList; +/** + * @brief HiAppEvent_Watcher node. + * + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @since 12 + * @version 1.0 + */ +typedef struct HiAppEvent_Watcher HiAppEvent_Watcher; + +/** + * @brief Called when watcher receive the event. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param domain The domain of the event. + * @param appEventGroups The event group by the domain. + * @param groupLen The length of appEventGroups array. + * @since 12 + * @version 1.0 + */ +typedef void (*OH_HiAppEvent_OnReceive)( + const char* domain, const struct HiAppEvent_AppEventGroup* appEventGroups, uint32_t groupLen); + +/** + * @brief Called when watcher receive the event meet the condition. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param row The row of events received by watcher. + * @param size The size of events received by watcher. + * @since 12 + * @version 1.0 + */ +typedef void (*OH_HiAppEvent_OnTrigger)(int32_t row, int32_t size); + +/** + * @brief Called when watcher take the events. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param events The event json string array. + * @param eventLen The length of events array. + * @since 12 + * @version 1.0 + */ +typedef void (*OH_HiAppEvent_OnTake)(const char* const *events, int32_t eventLen); + /** * @brief Create a pointer to the ParamList. * @@ -367,6 +445,132 @@ int OH_HiAppEvent_Write(const char* domain, const char* name, enum EventType typ */ bool OH_HiAppEvent_Configure(const char* name, const char* value); +/** + * @brief Create a HiAppEvent_Watcher handler pointer to set the property. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param name The name of the watcher. + * @return Returns a pointer to the HiAppEvent_Watcher instance. + * @since 12 + * @version 1.0 + */ +HiAppEvent_Watcher* OH_HiAppEvent_CreateWatcher(const char* name); + +/** + * @brief Destroy the specified HiAppEvent_Watcher handle resource. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @since 12 + * @version 1.0 + */ +void OH_HiAppEvent_DestroyWatcher(HiAppEvent_Watcher* watcher); + +/** + * @brief Set the TriggerCondition to trigger the onTrigger callback. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @param row The row of write events that trigger the onTrigger callback. + * @param size The size of write events that trigger the onTrigger callback. + * @param timeOut The interval for trigger the onTrigger callback. + * @return Returns {@code 0} if set TriggerCondition is successful, and returns a + * negative integer if set fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_SetTriggerCondition(HiAppEvent_Watcher* watcher, uint32_t row, uint32_t size, uint32_t timeOut); + +/** + * @brief Set the AppEventFilter, which is used to filter events monitored by the watcher. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @param domain The name of the event domain to be monitored by the watcher.. + * @param eventTypes The types of the events to be monitored by the watcher.0x08 means BEHAVIOR,0x04 means + * SECURITY, 0x02 means STATISTIC,0x01 means FAULT, 0xff and 0x00 means all. + * @param names The names of the events to be monitored by the watcher. + * @param namesLen The length of names array. + * @return Returns {@code 0} if set AppEventFilter is successful, and returns a + * negative integer if set fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_SetAppEventFilter(HiAppEvent_Watcher* watcher, const char* domain, uint8_t eventTypes, + const char* const *names, int namesLen); + +/** + * @brief Set the onTrigger callback. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @param onTrigger The callback of the watcher. + * @return Returns {@code 0} if set OnTrigger is successful, and returns a + * negative integer if set fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_SetWatcherOnTrigger(HiAppEvent_Watcher* watcher, OH_HiAppEvent_OnTrigger onTrigger); + +/** + * @brief Set the OnReceive callback. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @param onReceive The callback of the watcher. + * @return Returns {@code 0} if set OnReceive is successful, and returns a + * negative integer if set fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent_OnReceive onReceive); + +/** + * @brief Set the AppEventFilter, which is used to filter events monitored by the watcher. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @param size The the threshold size per read. + * @param onTake The callback of the watcher. + * @return Returns {@code 0} if remove watcher is successful, and returns a + * negative integer if remove fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH_HiAppEvent_OnTake onTake); + +/** + * @brief Add watcher to receive the event. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance which receive the event. + * @return Returns {@code 0} if add watcher is successful, and returns a + * negative integer if add fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_AddWatcher(HiAppEvent_Watcher* watcher); + +/** + * @brief Remove watcher. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @param watcher The pointer to the HiAppEvent_Watcher instance. + * @return Returns {@code 0} if remove watcher is successful, and returns a + * negative integer if remove fail. + * @since 12 + * @version 1.0 + */ +int OH_HiAppEvent_RemoveWatcher(HiAppEvent_Watcher* watcher); + +/** + * @brief Clear all local logging data of the application. + * + * @SystemCapability.HiviewDFX.HiAppEvent + * @since 12 + * @version 1.0 + */ +void OH_HiAppEvent_ClearData(); #ifdef __cplusplus } #endif diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h index 66aa52061..bdc57665f 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h @@ -79,6 +79,70 @@ extern "C" { */ #define EVENT_DISTRIBUTED_SERVICE_START "hiappevent.distributed_service_start" +/** + * @brief app crash event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_APP_CRASH "APP_CRASH" + +/** + * @brief app freeze event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_APP_FREEZE "APP_FREEZE" + +/** + * @brief app launch event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_APP_LAUNCH "APP_LAUNCH" + +/** + * @brief app scroll jank event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_SCROLL_JANK "SCROLL_JANK" + +/** + * @brief app cpu usage high event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_CPU_USAGE_HIGH "CPU_USAGE_HIGH" + +/** + * @brief app battery usage event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_BATTERY_USAGE "BATTERY_USAGE" + +/** + * @brief app resource overlimit event. + * + * @since 12 + * @version 1.0 + */ +#define EVENT_RESOURCE_OVERLIMIT "RESOURCE_OVERLIMIT" + +/** + * @brief OS domain. + * + * @since 12 + * @version 1.0 + */ +#define DOMAIN_OS "OS" + #ifdef __cplusplus } #endif -- Gitee From 9e5698bb42f00ec92db91752f2e77ef335bdc1f7 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Sat, 2 Mar 2024 10:51:45 +0800 Subject: [PATCH 2/5] update hiviewdfx/hiappevent/include/hiappevent/hiappevent.h. Signed-off-by: yuhaoqiang --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index e967770a3..cd74ca7b2 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -486,7 +486,7 @@ int OH_HiAppEvent_SetTriggerCondition(HiAppEvent_Watcher* watcher, uint32_t row, * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. - * @param domain The name of the event domain to be monitored by the watcher.. + * @param domain The name of the event domain to be monitored by the watcher. * @param eventTypes The types of the events to be monitored by the watcher.0x08 means BEHAVIOR,0x04 means * SECURITY, 0x02 means STATISTIC,0x01 means FAULT, 0xff and 0x00 means all. * @param names The names of the events to be monitored by the watcher. -- Gitee From 985faf003c6ed749ef126929a47809c88d6d66e6 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Tue, 5 Mar 2024 17:35:18 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- .../include/hiappevent/hiappevent.h | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index cd74ca7b2..c84823537 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -108,13 +108,14 @@ enum EventType { }; /** - * @brief Definition of HiAppEvent_AppEventInfo object. + * @brief The HiAppEvent_AppEventInfo structure is used to represent event information in an application, including + * the event's domain, name, type, and parameters. * * @SystemCapability.HiviewDFX.HiAppEvent * @since 12 * @version 1.0 */ -struct HiAppEvent_AppEventInfo { +typedef struct HiAppEvent_AppEventInfo { /* The domain of the event. */ const char* domain; /* The name of the event. */ @@ -123,23 +124,25 @@ struct HiAppEvent_AppEventInfo { enum EventType type; /* The json string of the parameter. */ const char* params; -}; +} HiAppEvent_AppEventInfo; /** - * @brief Defines the event group. + * @brief The HiAppEvent_AppEventGroup structure represents a group of events in an application. It contains the name + * of the event group, an array of HiAppEvent_AppEventInfo structures representing individual events grouped by the + * name, and the length of the event array. * * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 12 * @version 1.0 */ -struct HiAppEvent_AppEventGroup { +typedef struct HiAppEvent_AppEventGroup { /* The name of the event. */ const char* name; /* The event array which is group by the name. */ const struct HiAppEvent_AppEventInfo* appEventInfos; /* The length of appEventInfos array. */ uint32_t infoLen; -}; +} HiAppEvent_AppEventGroup; /** * @brief Event param list node. @@ -150,7 +153,8 @@ struct HiAppEvent_AppEventGroup { typedef struct ParamListNode* ParamList; /** - * @brief HiAppEvent_Watcher node. + * @brief The HiAppEvent_Watcher structure is designed for event monitoring, allowing it to be invoked when the event + * occurs. * * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 12 @@ -159,7 +163,8 @@ typedef struct ParamListNode* ParamList; typedef struct HiAppEvent_Watcher HiAppEvent_Watcher; /** - * @brief Called when watcher receive the event. + * @brief The OH_HiAppEvent_OnReceive function acts as the callback function for the HiAppEvent_Watcher. It is called + * when an event occurs. * * @SystemCapability.HiviewDFX.HiAppEvent * @param domain The domain of the event. @@ -467,7 +472,9 @@ HiAppEvent_Watcher* OH_HiAppEvent_CreateWatcher(const char* name); void OH_HiAppEvent_DestroyWatcher(HiAppEvent_Watcher* watcher); /** - * @brief Set the TriggerCondition to trigger the onTrigger callback. + * @brief The interface to set trigger conditions for the watcher. Three trigger conditions can be set through this + * interface and any of the condition which is set over than 0 met, the onTrigger callback set through + * OH_HiAppEvent_SetWatcherOnTrigger will be invoked. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -482,7 +489,7 @@ void OH_HiAppEvent_DestroyWatcher(HiAppEvent_Watcher* watcher); int OH_HiAppEvent_SetTriggerCondition(HiAppEvent_Watcher* watcher, uint32_t row, uint32_t size, uint32_t timeOut); /** - * @brief Set the AppEventFilter, which is used to filter events monitored by the watcher. + * @brief The interface to set the AppEventFilter which defines the kind of app events will be received by the watcher. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -500,7 +507,9 @@ int OH_HiAppEvent_SetAppEventFilter(HiAppEvent_Watcher* watcher, const char* dom const char* const *names, int namesLen); /** - * @brief Set the onTrigger callback. + * @brief The interface to set onTrigger callback for watcher. If the OnReceive callback is not be set, and has been set + * to nullptr, the app events received will be saved. When the new saved appEvents met conditions set by + * OH_HiAppEvent_SetTriggerCondition, The onTrigger callback will be invoked. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -513,7 +522,8 @@ int OH_HiAppEvent_SetAppEventFilter(HiAppEvent_Watcher* watcher, const char* dom int OH_HiAppEvent_SetWatcherOnTrigger(HiAppEvent_Watcher* watcher, OH_HiAppEvent_OnTrigger onTrigger); /** - * @brief Set the OnReceive callback. + * @brief The interface to set onReceive callback for watcher. When the watcher received an app event, the onReceive + * call back set will be invoked. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -526,7 +536,7 @@ int OH_HiAppEvent_SetWatcherOnTrigger(HiAppEvent_Watcher* watcher, OH_HiAppEvent int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent_OnReceive onReceive); /** - * @brief Set the AppEventFilter, which is used to filter events monitored by the watcher. + * @brief The interface to take saved events for the watcher. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -540,7 +550,7 @@ int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH_HiAppEvent_OnTake onTake); /** - * @brief Add watcher to receive the event. + * @brief The interface to add the watcher. The watcher start receiving app events after it was added. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance which receive the event. @@ -552,7 +562,7 @@ int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH int OH_HiAppEvent_AddWatcher(HiAppEvent_Watcher* watcher); /** - * @brief Remove watcher. + * @brief The interface to remove the watcher. The watcher stop receiving app events after it was removed. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -564,7 +574,7 @@ int OH_HiAppEvent_AddWatcher(HiAppEvent_Watcher* watcher); int OH_HiAppEvent_RemoveWatcher(HiAppEvent_Watcher* watcher); /** - * @brief Clear all local logging data of the application. + * @brief Clear all local event data saved of the application. * * @SystemCapability.HiviewDFX.HiAppEvent * @since 12 -- Gitee From 254c7f104f2fe29097c15e4e8af2edd32f1fb856 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Wed, 6 Mar 2024 11:44:52 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- .../hiappevent/include/hiappevent/hiappevent.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index c84823537..48d12bab2 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -507,9 +507,9 @@ int OH_HiAppEvent_SetAppEventFilter(HiAppEvent_Watcher* watcher, const char* dom const char* const *names, int namesLen); /** - * @brief The interface to set onTrigger callback for watcher. If the OnReceive callback is not be set, and has been set - * to nullptr, the app events received will be saved. When the new saved appEvents met conditions set by - * OH_HiAppEvent_SetTriggerCondition, The onTrigger callback will be invoked. + * @brief The interface to set onTrigger callback for watcher. If the OnReceive callback is not be set or has been set + * to nullptr, the app events received by the watcher will be saved. When the new saved appEvents met the conditions set + * by OH_HiAppEvent_SetTriggerCondition, the onTrigger callback will be invoked. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -523,7 +523,7 @@ int OH_HiAppEvent_SetWatcherOnTrigger(HiAppEvent_Watcher* watcher, OH_HiAppEvent /** * @brief The interface to set onReceive callback for watcher. When the watcher received an app event, the onReceive - * call back set will be invoked. + * callback set will be invoked. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -536,7 +536,7 @@ int OH_HiAppEvent_SetWatcherOnTrigger(HiAppEvent_Watcher* watcher, OH_HiAppEvent int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent_OnReceive onReceive); /** - * @brief The interface to take saved events for the watcher. + * @brief The interface to take saved events data for the watcher. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -550,7 +550,7 @@ int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH_HiAppEvent_OnTake onTake); /** - * @brief The interface to add the watcher. The watcher start receiving app events after it was added. + * @brief The interface to add the watcher. The watcher will start receiving app events after it is added. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance which receive the event. @@ -562,7 +562,7 @@ int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH int OH_HiAppEvent_AddWatcher(HiAppEvent_Watcher* watcher); /** - * @brief The interface to remove the watcher. The watcher stop receiving app events after it was removed. + * @brief The interface to remove the watcher. The watcher will stop receiving app events after it is removed. * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. @@ -574,7 +574,7 @@ int OH_HiAppEvent_AddWatcher(HiAppEvent_Watcher* watcher); int OH_HiAppEvent_RemoveWatcher(HiAppEvent_Watcher* watcher); /** - * @brief Clear all local event data saved of the application. + * @brief Clear all local saved event data of the application. * * @SystemCapability.HiviewDFX.HiAppEvent * @since 12 -- Gitee From ef458e74aec5a4be91f67dcab0f9b2f60fc66eda Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Thu, 7 Mar 2024 14:33:10 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang --- hiviewdfx/hiappevent/include/hiappevent/hiappevent.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index 48d12bab2..e6b1b273e 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -185,7 +185,7 @@ typedef void (*OH_HiAppEvent_OnReceive)( * @since 12 * @version 1.0 */ -typedef void (*OH_HiAppEvent_OnTrigger)(int32_t row, int32_t size); +typedef void (*OH_HiAppEvent_OnTrigger)(int row, int size); /** * @brief Called when watcher take the events. @@ -196,7 +196,7 @@ typedef void (*OH_HiAppEvent_OnTrigger)(int32_t row, int32_t size); * @since 12 * @version 1.0 */ -typedef void (*OH_HiAppEvent_OnTake)(const char* const *events, int32_t eventLen); +typedef void (*OH_HiAppEvent_OnTake)(const char* const *events, uint32_t eventLen); /** * @brief Create a pointer to the ParamList. @@ -486,7 +486,7 @@ void OH_HiAppEvent_DestroyWatcher(HiAppEvent_Watcher* watcher); * @since 12 * @version 1.0 */ -int OH_HiAppEvent_SetTriggerCondition(HiAppEvent_Watcher* watcher, uint32_t row, uint32_t size, uint32_t timeOut); +int OH_HiAppEvent_SetTriggerCondition(HiAppEvent_Watcher* watcher, int row, int size, int timeOut); /** * @brief The interface to set the AppEventFilter which defines the kind of app events will be received by the watcher. @@ -540,14 +540,14 @@ int OH_HiAppEvent_SetWatcherOnReceive(HiAppEvent_Watcher* watcher, OH_HiAppEvent * * @SystemCapability.HiviewDFX.HiAppEvent * @param watcher The pointer to the HiAppEvent_Watcher instance. - * @param size The the threshold size per read. + * @param eventNum The num of events to take. * @param onTake The callback of the watcher. * @return Returns {@code 0} if remove watcher is successful, and returns a * negative integer if remove fail. * @since 12 * @version 1.0 */ -int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t size, OH_HiAppEvent_OnTake onTake); +int OH_HiAppEvent_TakeWatcherData(HiAppEvent_Watcher* watcher, uint32_t eventNum, OH_HiAppEvent_OnTake onTake); /** * @brief The interface to add the watcher. The watcher will start receiving app events after it is added. -- Gitee