#  Copyright (c) 2021-2022 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
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  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 divided 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: ACE

JS_CARD_FIRST_RENDER_TIME:
  __BASE: {type: STATISTIC, level: MINOR, desc: js card first render duration}
  SESSION_ID: {type: STRING, desc: session id}
  DURATION: {type: UINT64, desc: duration from js card created to first render}

JS_CARD_FIRST_UPDATE_TIME:
  __BASE: {type: STATISTIC, level: MINOR, desc: js card first update duration}
  SESSION_ID: {type: STRING, desc: session id}
  DURATION: {type: UINT64, desc: duration from js card first update to render}

FRAMEWORK_APP_START_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: application start exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

FRAMEWORK_PAGE_ROUTER_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: page router exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }
  PAGE_NAME: { type: STRING, desc: page name }

COMPONENT_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: component exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

API_CHANNEL_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: API channel exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

RENDER_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: render exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }
  RENDER_OBJECT_NAME: { type: STRING, desc: render object name }

JS_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: JS exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

ANIMATION_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: animation exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

EVENT_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: event exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

PLUGIN_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: plugin exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

INTERNATIONALIZATION_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: internationalization exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

ACCESSIBILITY_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: accessibility exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

FORM_EXCEPTION:
  __BASE: { type: FAULT, level: MINOR, desc: form exception }
  ERROR_TYPE: { type: INT32, desc: error type }
  PACKAGE_NAME: { type: STRING, desc: package name }

JS_ERROR:
  __BASE: { type: FAULT, level: MINOR, desc: JS runtime exception }
  PACKAGE_NAME: { type: STRING, desc: package name }
  REASON: { type: STRING, desc: js runtime error reason }
  SUMMARY: { type: STRING, desc: js runtime error summary }
  FINGERPRINT: {type: STRING, desc: unique id for grouping same fault}
  PANME: {type: STRING, desc: process name}
  FIRST_FRAME: {type: STRING, desc: first stack info}
  SECOND_FRAME: {type: STRING, desc: second stack info}
  LAST_FRAME: {type: STRING, desc: last stack info}

UI_BLOCK_3S:
  __BASE: {type: FAULT, level: CRITICAL, desc: The thread is blocked for 3s }
  UID: {type: INT32, desc: application uid}
  PACKAGE_NAME: {type: STRING, desc: application package name}
  PROCESS_NAME: {type: STRING, desc: application process name}
  MSG: {type: STRING, desc: application event message}
  CMD: {type: STRING, desc: application event cmd}

UI_BLOCK_6S:
  __BASE: {type: FAULT, level: CRITICAL, desc: The thread is blocked for 6s }
  UID: {type: INT32, desc: application uid}
  PACKAGE_NAME: {type: STRING, desc: application package name}
  PROCESS_NAME: {type: STRING, desc: application process name}
  MSG: {type: STRING, desc: application event message}
  CMD: {type: STRING, desc: application event cmd}

UI_BLOCK_RECOVERED:
  __BASE: {type: FAULT, level: CRITICAL, desc: The thread is recovered }
  UID: {type: INT32, desc: application uid}
  PACKAGE_NAME: {type: STRING, desc: application package name}
  PROCESS_NAME: {type: STRING, desc: application process name}
  MSG: {type: STRING, desc: application event message}
  CMD: {type: STRING, desc: application event cmd}

UI_BLOCK_DIALOG:
  __BASE: {type: FAULT, level: CRITICAL, desc: Dialog is displayed when the thread is blocked }
  PID: {type: INT32, desc: application pid}
  UID: {type: INT32, desc: application uid}
  PACKAGE_NAME: {type: STRING, desc: application package name}
  PROCESS_NAME: {type: STRING, desc: application process name}
  MSG: {type: STRING, desc: application event message}

JANK_STATS_APP:
  __BASE: {type: STATISTIC, level: MINOR, tag: performance, desc: jank statistics}
  STARTTIME: {type: INT64, desc: begin time since last report}
  DURATION: {type: INT64, desc: duration since last report}
  VERSION_CODE: {type: UINT32, desc: app version code}
  VERSION_NAME: {type: STRING, desc: app version name}
  BUNDLE_NAME: {type: STRING, desc: package name}
  ABILITY_NAME: {type: STRING, desc: ability name}
  PAGE_URL: {type: STRING, desc: page name}
  JANK_STATS: {type: UINT16, arrsize: 8, desc: jank frame stats}
  JANK_STATS_VER: {type: UINT32, desc: jank range version}

INTERACTION_COMPLETED_LATENCY:
  __BASE: {type: BEHAVIOR, level: MINOR, tag: performance, desc: interaction complete statistics}
  APP_PID: {type: INT32, desc: app pid}
  BUNDLE_NAME: {type: STRING, desc: package name}
  PROCESS_NAME: {type: STRING, desc: process name}
  ABILITY_NAME: {type: STRING, desc: ability name}
  PAGE_URL: {type: STRING, desc: page url}
  VERSION_CODE: {type: INT32, desc: version code}
  VERSION_NAME: {type: STRING, desc: version name}
  SCENE_ID: {type: STRING, desc: interaction scene id}
  SOURCE_TYPE: {type: STRING, desc: scene source type}
  INPUT_TIME: {type: UINT64, desc: input time when multimodel receive from kernel}
  ANIMATION_START_LATENCY: {type: UINT64, desc: animation start time of the scene}
  ANIMATION_END_LATENCY: {type: UINT64, desc: end time of the scene}
  E2E_LATENCY: {type: UINT64, desc: end to end time}
  NOTE: {type: STRING, desc: extra infomation}

INTERACTION_APP_JANK:
  __BASE: {type: BEHAVIOR, level: MINOR, tag: performance, desc: interaction jank statistics}
  UNIQUE_ID: {type: INT32, desc: unique id}
  SCENE_ID: {type: STRING, desc: interaction scene id}
  PROCESS_NAME: {type: STRING, desc: process name}
  MODULE_NAME: {type: STRING, desc: package name}
  ABILITY_NAME: {type: STRING, desc: ability name}
  PAGE_URL: {type: STRING, desc: page url}
  VERSION_CODE: {type: INT32, desc: version code}
  VERSION_NAME: {type: STRING, desc: version name}
  STARTTIME: {type: UINT64, desc: interaction scene begin time}
  DURATION: {type: UINT64, desc: interaction duration}
  TOTAL_FRAMES: {type: INT32, desc: total app frames during the scene}
  TOTAL_MISSED_FRAMES: {type: INT32, desc: total missed frames during the scene}
  MAX_FRAMETIME: {type: UINT64, desc: max single frame time during the scene}
  MAX_SEQ_MISSED_FRAMES: {type: INT32, desc: max successive missed frames during the scene}
  NOTE: {type: STRING, desc: extra infomation}