From 5295fbf68a13910a7fdbf51fe722d92c2bb389bd Mon Sep 17 00:00:00 2001 From: wangfeifan Date: Mon, 24 Jul 2023 11:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=89=93=E5=8D=B0=E6=89=93?= =?UTF-8?q?=E7=82=B9=E4=B8=8A=E4=BA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangfeifan --- hisysevent.yaml | 129 +++++++++++++++++++++------- services/include/hisys_event_util.h | 2 +- 2 files changed, 97 insertions(+), 34 deletions(-) diff --git a/hisysevent.yaml b/hisysevent.yaml index f7fd1d5..717634e 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,44 +11,107 @@ # See the License for the specific language governing permissions and # limitations under the License. -##################################################### -# below is the format of defining event # -##################################################### -#domain: domain name. [Only one domain name can be defined at the top] -# -#author: the author name who defined this event. -#date: the date when this event was defined, format is YYYY-MM-DD. -#logged: source file which refer to this event. -#usage: the usage of this event. -#//Define event name and event properties. -#@EVENT_NAME: the event definition part begin. -# // __BASE is used for defining the basic info of the event. -# // "type" optional values are: FAULT, STATISTICS, SECURITY, BEHAVIOR. -# // "level" optional values are: CRITICAL, MINOR. -# // "tag" set tags with may used by subscriber of this event, multiple tags devided by space. -# // "desc" full description of this event. -# @PARAMETER: {type: parameter type, arrsize: array length(optional), desc: parameter description}. -# // follow the __BASE block, each line defines a parameter of this event. -# // "type" optional values are: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING. -# // "arrsize" of the parameter is an array, set a non-zero value. -# // "desc" full description of this parameter. - -##################################################### -# Example of some hiviewdfx events definition # -##################################################### - domain: PRINT -SERVICE_FAULT: - __BASE: {type: FAULT, level: CRITICAL, desc: The event is service fault } - FAULT_TYPE: {type: INT32, desc: fault id } - MODULE_NAME: {type: STRING, desc: module name } - ERROR_TYPE: {type: INT32, desc: error type } +CANCEL_PRINT: + __BASE: {type: BEHAVIOR, level: MINOR, desc: cancel_print} + BEHAVIOR_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +CONNECT_PRINTER: + __BASE: {type: BEHAVIOR, level: MINOR, desc: connect_printer} + BEHAVIOR_CODE: {type: STRING, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +EPRINT_CONVERT_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: eprint_convert_success} + BEHAVIOR_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +EPRINT_UPLOAD_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: eprint_upload_success} + BEHAVIOR_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +FAULT_CONNECT_PRINT: + __BASE: {type: FAULT, level: MINOR, desc: fault_connect_print} + FAULT_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + SCENE: {type: STRING, desc: scene} + +FAULT_FILE_PREVIEW: + __BASE: {type: FAULT, level: MINOR, desc: fault_file_preview} + FAULT_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + SCENE: {type: STRING, desc: scene} + +FILE_PREVIEW_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: file_preview_success} + BEHAVIOR_CODE: {type: STRING, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +PRINT_BUTTON_CLICK_COUNT: + __BASE: {type: STATISTIC, level: MINOR, desc: print_button_click_count} + BEHAVIOR_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} + +PRINT_EXCEPTION: + __BASE: {type: FAULT, level: MINOR, desc: print_exception} + FAULT_CODE: {type: INT32, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + SCENE: {type: STRING, desc: scene} + +PRINT_SUCCESS: + __BASE: {type: BEHAVIOR, level: MINOR, desc: print_success} + BEHAVIOR_CODE: {type: STRING, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} RUNTIME_FAULT: __BASE: {type: FAULT, level: CRITICAL, desc: The event is runtime fault } - FAULT_TYPE: {type: INT32, desc: fault id } ERROR_TYPE: {type: INT32, desc: error type } + FAULT_TYPE: {type: INT32, desc: fault id } + +SERVICE_FAULT: + __BASE: {type: FAULT, level: CRITICAL, desc: The event is service fault } + ERROR_TYPE: {type: INT32, desc: error type } + FAULT_TYPE: {type: INT32, desc: fault id } + MODULE_NAME: {type: STRING, desc: module name } + +START_PRINT: + __BASE: {type: BEHAVIOR, level: MINOR, desc: start_print} + BEHAVIOR_CODE: {type: STRING, desc: behavior_code} + MSG: {type: STRING, desc: msg} + PACKAGE_NAME: {type: STRING, desc: package_name} + PROCESS_NAME: {type: STRING, desc: process_name} + PVERSIONID: {type: STRING, desc: version} USAGETIME_STATISTIC: __BASE: {type: STATISTIC, level: MINOR, desc: The event is usagetime statistic } diff --git a/services/include/hisys_event_util.h b/services/include/hisys_event_util.h index 254aa41..5076733 100644 --- a/services/include/hisys_event_util.h +++ b/services/include/hisys_event_util.h @@ -26,7 +26,7 @@ namespace OHOS::Print { static void faultPrint(std::string scene, std::string msg); private: - static constexpr char HW_PRINT_SPOOLER[] = "HW_PRINT_SPOOLER"; + static constexpr char HW_PRINT_SPOOLER[] = "PRINT"; static const int PRINT_SUCCESS = 1003; static const int FAULT_PRINT = 3002;