The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** directory of the system. You can use this tool to subscribe to real-time system events or query historical system vents.
## Subscribing to Real-Time System Events<a name="section1210623418527"></a>
## Subscribing to Real-Time System Events
-Command for subscribing to real-time system events:
- Command for subscribing to real-time system events:
```
hisysevent -r
...
...
@@ -15,10 +16,10 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin**
Description of command options:
| Option| Description|
| -------- | --------- |
| -r | Subscribes to real-time system events based on the default settings. When this option is specified, any real-time system event will be printed on the console.|
| -------- | -------- |
| -r | Subscribes to real-time system events based on the default settings. When this option is specified, any real-time system event will be printed on the console.|
-Command for enabling the debugging mode:
- Command for enabling the debugging mode:
```
hisysevent -r -d
...
...
@@ -27,10 +28,10 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin**
Description of command options:
| Option| Description|
| -------- | --------- |
| -d | Subscribes to real-time system events in debugging mode.|
| -------- | -------- |
| -d | Subscribes to real-time system events in debugging mode.|
-Command for subscribing to real-time system events by event tag:
- Command for subscribing to real-time system events by event tag:
>If **-t**, **-o**, and **-n** are specified, the system checks whether the configured event tag is null. If the event tag is not null, the system filters system events based on the matching rules for the event tag. Otherwise, the system filters system events based on the matching rules for the event domain and event name.
> **NOTE**
> If **-t**, **-o**, and **-n** are specified, the system checks whether the configured event tag is null. If the event tag is not null, the system filters system events based on the matching rules for the event tag. Otherwise, the system filters system events based on the matching rules for the event domain and event name.
## Querying Historical System Events<a name="section1210623418539"></a>
## Querying Historical System Events
-Command for querying historical system events:
- Command for querying historical system events:
```
hisysevent -l
...
...
@@ -98,10 +95,10 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin**
Description of command options:
| Option| Description|
| -------- | --------- |
| -l | Queries historical system events based on the default settings. A maximum of 1,000 latest system events will be returned.|
| -------- | -------- |
| -l | Queries historical system events based on the default settings. A maximum of 1,000 latest system events will be returned.|
-Command for querying historical system events within the specified period of time:
- Command for querying historical system events within the specified period of time:
```
hisysevent -l -s <begin time> -e <end time>
...
...
@@ -110,21 +107,20 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin**
Description of command options:
| Option| Description|
| -------- | --------- |
| -s | Start time for querying historical system events. Only system events generated after the start time are returned.|
| -e | End time for querying historical system events. Only system events generated before the end time are returned.|
| -------- | -------- |
| -s | Start time for querying historical system events. Only system events generated after the start time are returned.|
| -e | End time for querying historical system events. Only system events generated before the end time are returned.|
{"domain_":"GRAPHIC","name_":"NO_DRAW","type_":1,"time_":1501964222980,"tz_":"+0000","pid_":1505,"tid_":1585,"uid_":10002,"PID":1505,"UID":10002,"ABILITY_NAME":"","MSG":"It took 1957104259905ns to draw, UI took 0ns to draw, RSRenderThread took 8962625ns to draw, RSRenderThread dropped 0 UI Frames","level_":"MINOR","id_":"1708287249901948387","info_":"isResolved,eventId:0"}
{"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501964222994,"tz_":"+0000","pid_":623,"tid_":1445,"uid_":1201,"SUB_EVENT_TYPE":"NO_DRAW","EVENT_TIME":"20170805201702","MODULE":"NO_DRAW","PNAME":"NO_DRAW","REASON":"NO_DRAW","DIAG_INFO":"","STACK":"SUMMARY:\n","HIVIEW_LOG_FILE_PATHS":["/data/log/faultlog/faultlogger/appfreeze-NO_DRAW-10002-20170805201702"],"DOMAIN":"GRAPHIC","STRING_ID":"NO_DRAW","PID":1505,"UID":10002,"PACKAGE_NAME":"NO_DRAW","PROCESS_NAME":"","MSG":"It took 1956945826265ns to draw, UI took 0ns to draw, RSRenderThread took 9863293ns to draw, RSRenderThread dropped 0 UI Frames\n","level_":"CRITICAL","tag_":"STABILITY","id_":"10448522101019619655","info_":""}
```
-Command for setting the maximum number of historical events that can be queried:
- Command for setting the maximum number of historical events that can be queried:
```
hisysevent -l -m <max hisysevent count>
...
...
@@ -133,18 +129,36 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin**
Description of command options:
| Option| Description|
| -------- | --------- |
| -m | Maximum number of historical system events that can be queried. The value ranges from **0** to **1000**. The number of returned system events is not more than the value of this parameter.|
| -------- | -------- |
| -m | Maximum number of historical system events that can be queried. The value ranges from **0** to **1000**. The number of returned system events is not more than the value of this parameter.|
| -v | Used with the subscription command **-r** and query command **-l**. If system event validity check is enabled, invalid content contained in system events will be highlighted in red.|
# The **HAPPEN_TIME** and **VERSION** fields are not configured in the YAML file for the **APP_FREEZE** event that belongs to the **RELIABILITY** domain. Therefore, the two fields are highlighted in red.