提交 ca8de8a7 编写于 作者: X xuyong

Optimize the standardization of developing guides for hisysevent&hitracechai.

Signed-off-by: Nxuyong <xuyong59@huawei.com>
上级 af444f99
......@@ -6,18 +6,18 @@
### Function Introduction
If HiSysEvent logging is required for a component, you need to define a YAML file and [configure the YAML file path](#configuring-the-yaml-file-path) in the **bundle.json** file. During compilation, the OpenHarmony compilation framework will use the Python compilation script to parse and verify all the YAML files configured in the **bundle.json** file. On completion, the compilation framework will summarize the configuration information in the YAML files and convert the information into a JSON file named **hisysevent.def**. After that, the compilation framework will put the JSON file to a specified path as the basis for the system to determine whether to log system events.
If HiSysEvent logging is required for a component, you need to define a YAML file and [configure the YAML file path](#verifying-the-yaml-file) in the **bundle.json** file. During compilation, the OpenHarmony compilation framework will use the Python compilation script to parse and verify all the YAML files configured in the **bundle.json** file. On completion, the compilation framework will summarize the configuration information in the YAML files and convert the information into a JSON file named **hisysevent.def**. After that, the compilation framework will put the JSON file to a specified path as the basis for the system to determine whether to log system events.
### Basic Concepts
Understanding the following concepts would be helpful for you in configuring HiSysEvent logging.
- Event domain<br>Represents the domain to which an event belongs. It is specified by the **domain** field in the YAML file. For details, see [domain](#example) in the example YAML file.
- Event domain<br>Represents the domain to which an event belongs. It is specified by the **domain** field in the YAML file. For details, see [domain](#writing-a-yaml-file) in the example YAML file.
- Event name<br>Indicates the events in an event domain. For details, see [EVENT\_NAMEA/EVENT\_NAMEB](#example) in the example YAML file.
- Event name<br>Indicates the events in an event domain. For details, see [EVENT\_NAMEA/EVENT\_NAMEB](#writing-a-yaml-file) in the example YAML file.
- Parameter<br>Defines the key values in an event name. For details, see [__BASE/NAME1/NAME2](#example) in the example YAML file.
- Parameter<br>Defines the key values in an event name. For details, see [__BASE/NAME1/NAME2](#writing-a-yaml-file) in the example YAML file.
### Constraints
......@@ -47,11 +47,12 @@ Constraints on the event domain, event name, and parameter
| arrsize | Length of the parameter of the array type. This field is optional.<br>Value:<br>1-100|
| desc | Parameter description. This field is mandatory.<br>Rule:<br>The description contains 3 to 128 characters, including a to z, A to Z, 0 to 9, and underscores (_).|
## How to Develop
## Writing a YAML File
### Writing a YAML File
### Writing Rules
**Writing Rules**
- Event domain naming rules:
- The name must start with a letter and can contain only uppercase letters, digits, and underscores (&#95;).
......@@ -68,7 +69,7 @@ Constraints on the event domain, event name, and parameter
- The number of parameters in an event domain cannot exceed 128.
### Example
**Example**
- In the example YAML file, the event domain name is **MODULEA**. The event domain contains two events named **EVENT_NAMEA** and **EVENT_NAMEB**.
......@@ -96,10 +97,10 @@ Constraints on the event domain, event name, and parameter
```
## Verifying the YAML File
### Verifying the YAML File
### Configuring the YAML File Path
**Configuring the YAML File Path**
In the **bundle.json** file, use the **hisysevent_config** attribute to specify the YAML file path.
......@@ -150,7 +151,7 @@ In the **bundle.json** file, use the **hisysevent_config** attribute to specify
> The YAML file can be placed in any directory of the component project as needed. You only need to specify the path in the **bundle.json** file.
### Compiling YAML Files
**Compiling YAML Files**
- Perform full compilation.
- During full compilation of the system, the configurations in the YAML files of all components are summarized. After the compilation is complete, the **hisysevent.def** file will be generated in the specified directory.
......
......@@ -6,18 +6,18 @@
### 功能简介
组件若有HiSysEvent事件的打点需求,则需要先定义yaml文件并在bundle.json文件中[配置yaml文件的路径](subsys-dfx-hisysevent-logging-config.md#配置yaml文件路径)。OpenHarmony编译框架在编译过程中则会通过python编译脚本解析校验bundle.json文件指定的所有yaml文件。在解析校验之后,编译框架会将这些yaml文件中配置的信息汇总转换成名为hisysevent.def的json文件。最后,将此json文件打包到系统指定路径下,用作HiSysEvent事件落盘的判断依据。
组件若有HiSysEvent事件的打点需求,则需要先定义yaml文件并在bundle.json文件中[配置yaml文件的路径](subsys-dfx-hisysevent-logging-config.md#验证yaml文件)。OpenHarmony编译框架在编译过程中则会通过python编译脚本解析校验bundle.json文件指定的所有yaml文件。在解析校验之后,编译框架会将这些yaml文件中配置的信息汇总转换成名为hisysevent.def的json文件。最后,将此json文件打包到系统指定路径下,用作HiSysEvent事件落盘的判断依据。
### 基本概念
在配置HiSysEvent打点之前,开发者应了解以下基本概念:
- 事件领域 用于标识事件所属的领域,在yaml文件中以domain为键值指定,可参考yaml文件样例中的[domain](subsys-dfx-hisysevent-logging-config.md#编写样例)
- 事件领域 用于标识事件所属的领域,在yaml文件中以domain为键值指定,可参考yaml文件样例中的[domain](subsys-dfx-hisysevent-logging-config.md#编写yaml文件)
- 事件名称 用于指定事件领域包含的所有事件,可参考yaml文件样例中的[EVENT_NAMEA/EVENT_NAMEB](subsys-dfx-hisysevent-logging-config.md#编写样例)
- 事件名称 用于指定事件领域包含的所有事件,可参考yaml文件样例中的[EVENT_NAMEA/EVENT_NAMEB](subsys-dfx-hisysevent-logging-config.md#编写yaml文件)
- 参数 用于定义某个事件名称包含的所有键值,可参考yaml文件样例中的[__BASE/NAME1/NAME2](subsys-dfx-hisysevent-logging-config.md#编写样例)
- 参数 用于定义某个事件名称包含的所有键值,可参考yaml文件样例中的[__BASE/NAME1/NAME2](subsys-dfx-hisysevent-logging-config.md#编写yaml文件)
### 约束与限制
......@@ -47,10 +47,13 @@
| desc | 字段作用:必选字段,用来对该参数进行描述。<br/>定义规则:<br/>-&nbsp;至少包含3个字符,最多包含128个字符,字符范围[a-zA-Z0-9&nbsp;_] |
## 编写yaml文件
## 开发步骤
### 编写规则
### 编写yaml文件
**编写规则**
- 事件领域命名规则:
- 字母开头,且只能由大写字母/数字/下划线组成;
......@@ -67,7 +70,7 @@
- 单个事件名称内包含的参数的个数不能超过128个。
### 编写样例
**编写样例**
- yaml文件样例指定的事件领域名称为MODULEA,该事件领域包含两个事件,名称分别是EVENT_NAMEA和EVENT_NAMEB。
......@@ -95,10 +98,10 @@
```
## 验证yaml文件
### 验证yaml文件
### 配置yaml文件路径
**配置yaml文件路径**
在bundle.json文件中通过hisysevent_config属性完成yaml文件的路径指定:
......@@ -149,7 +152,7 @@
> yaml文件可根据实际需求置于组件工程的任意目录下,只要在bundle.json文件指定即可。
### 编译yaml文件
**编译yaml文件**
- 全量编译:
- 全量编译整个系统,会将所有组件配置的yaml文件中的配置进行汇总,正常完成系统编译后,指定目录下就会生成hisysevent.def文件。
......
# HiSysEvent概述
## 概述
## 简介
HiSysEvent是面向OpenHarmony系统开发者提供的系统打点功能,通过在关键路径埋点来记录系统在运行过程中的重要信息,辅助开发者定位问题,此外还支持开发者将打点数据上传到云进行大数据质量度量。
......
......@@ -7,16 +7,18 @@
提供以下功能:
- HiLog流水日志,轻量系统类设备(参考内存≥128KiB)、小型系统类设备(参考内存≥1MiB)、标准系统类设备(参考内存≥128MB)适用。
- HiLog流水日志,标准系统类设备(参考内存≥128MB)适用。
- HiLog_Lite轻量化流水日志,轻量系统类设备(参考内存≥128KiB)、小型系统类设备(参考内存≥1MiB)适用。
- HiTraceChain分布式跟踪,标准系统类设备(参考内存≥128MiB)适用。
- HiTraceMeter性能跟踪,标准系统类设备(参考内存≥128MiB)适用。
- HiCollie卡死故障检测,标准系统类设备(参考内存≥128MiB)适用。
- HiSysEvent系统事件埋点,标准系统类设备(参考内存≥128MiB)适用。
- HiChecker缺陷扫描,标准系统类设备(参考内存≥128MB)适用。
- HiDumper信息导出,标准系统类设备(参考内存≥128MB)适用。
- Faultlogger崩溃故障检测,标准系统类设备(参考内存≥128MB)适用。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册