1fb726d48Sopenharmony_ci# HiSystemEvent 的抓取和展示说明
2fb726d48Sopenharmony_ci
3fb726d48Sopenharmony_ciHiSystemEvent 应用功耗模块主要是展示应用的各个子类别功耗占比信息、应用的资源申请使用记录信息、应用功耗异常事件信息、功耗关联系统状态信息。
4fb726d48Sopenharmony_ci
5fb726d48Sopenharmony_ci## HiSystemEvent 的抓取
6fb726d48Sopenharmony_ci
7fb726d48Sopenharmony_ci### HiSystemEvent 抓取配置参数
8fb726d48Sopenharmony_ci
9fb726d48Sopenharmony_ci打开 Start Hisystem Event Tracker Record 开关抓取 HiSystemEvent 数据。
10fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisyseventsetting.jpg)
11fb726d48Sopenharmony_ci再点击 Record setting,在 output file path 输入文件名 hiprofiler_data_hisystemevent.htrace,拖动滚动条设置 buffer size 大小是 64MB,抓取时长是 50s。
12fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemeventrecord.jpg)
13fb726d48Sopenharmony_ci点击 Trace command,就会根据上面的配置生成抓取命令,点击复制按钮,会将命令行复制。
14fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemcommand.jpg)
15fb726d48Sopenharmony_ci输入 hdc shell,进入设备,执行上述生成的命令。
16fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemeventemexcute.jpg)
17fb726d48Sopenharmony_ci执行完成后,进入指定目录查看,在/data/local/tmp 下就会生成 trace 文件。
18fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemeventfile.jpg)
19fb726d48Sopenharmony_ci
20fb726d48Sopenharmony_ci### HiSystemEvent 展示说明
21fb726d48Sopenharmony_ci
22fb726d48Sopenharmony_ci### HiSystemEvent 的 Energy 泳道图展示
23fb726d48Sopenharmony_ci
24fb726d48Sopenharmony_ci将抓取的 trace 文件导入 smartperf 界面查看。
25fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemeventsummary.jpg)
26fb726d48Sopenharmony_ci泳道图说明:
27fb726d48Sopenharmony_ci
28fb726d48Sopenharmony_ci-     Anomaly Event泳道: 显示系统异常和应用异常的ToolTip。
29fb726d48Sopenharmony_ci-     System Event泳道: 以条状图显示,红色代表后台任务(WORKSCHEDULER),黄色代表应用锁(POWER_RUNNINGLOCK),蓝色代表GPS定位(LOCATION)。
30fb726d48Sopenharmony_ci-     Power泳道:应用各个子类的功耗柱状图、折线图以及应用各个子类绘制的图例,鼠标的悬浮可以显示出各个子类功耗的具体值。
31fb726d48Sopenharmony_ci-     Brightness Nit泳道:鼠标悬浮可以显示屏幕亮度值。
32fb726d48Sopenharmony_ci-     Wifi Event Received泳道:鼠标悬浮可以显示WiFi信号强度值。
33fb726d48Sopenharmony_ci-     Audio Stream Change泳道:鼠标悬浮可以显示Audio状态(AUDIO_STREAM_CHANGE事件)。
34fb726d48Sopenharmony_ci-     Audio Volume Change泳道:鼠标悬浮可以显示Audio状态(AUDIO_VOLUME_CHANGE事件)。
35fb726d48Sopenharmony_ci-     Wifi State泳道:鼠标悬浮可以显示wifi开关状态(enable:开,disable:关)。
36fb726d48Sopenharmony_ci-     Bluetooth Br Switch State泳道:鼠标悬浮可以显示蓝牙开关状态(enable:开, disable:关)。
37fb726d48Sopenharmony_ci-     Location Switch State泳道:鼠标悬浮可以显示GPS开关状态(enable:开,disable:关)。
38fb726d48Sopenharmony_ci
39fb726d48Sopenharmony_ci### HiSystemEvent 的 Energy 泳道图的框选功能
40fb726d48Sopenharmony_ci
41fb726d48Sopenharmony_ci可以对 Energy 各泳道图进行框选,框选后在最下方的弹出层中会展示框选数据的统计表格。
42fb726d48Sopenharmony_ciSystem Details 的 Tab 页如图:
43fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemdetails.jpg)
44fb726d48Sopenharmony_ci
45fb726d48Sopenharmony_ci-     Event Name: 事件名称,事件包括后台任务,应用锁,GPS定位。
46fb726d48Sopenharmony_ci-     Time: 时间戳信息。
47fb726d48Sopenharmony_ci  点击事件名会显示该事件的详细信息的 Tab 页。
48fb726d48Sopenharmony_ci  ![GitHub Logo](../../figures/HiSystemEvent/systemselectdetals.jpg)
49fb726d48Sopenharmony_ci-     EVENT_NAME:事件名称。
50fb726d48Sopenharmony_ci-     PID:应用PID。
51fb726d48Sopenharmony_ci-     UID:应用UID。
52fb726d48Sopenharmony_ci-     TYPE:类型。
53fb726d48Sopenharmony_ci-     STATE:状态值。
54fb726d48Sopenharmony_ci-     LOG_LEVEL:日志级别。
55fb726d48Sopenharmony_ci-     NAME:NAME信息。
56fb726d48Sopenharmony_ci-     MESSAGE:MESSAGE信息。
57fb726d48Sopenharmony_ci-     TAG:锁名。
58fb726d48Sopenharmony_ci  Power Battery 的 Tab 页如图:
59fb726d48Sopenharmony_ci  ![GitHub Logo](../../figures/HiSystemEvent/hisyseventPowerBattery.jpg)
60fb726d48Sopenharmony_ci-     Gas Gauge: 电池电量。
61fb726d48Sopenharmony_ci-     Charge:充电状态。
62fb726d48Sopenharmony_ci-     Screen:屏幕状态。
63fb726d48Sopenharmony_ci-     Level:电池百分比。
64fb726d48Sopenharmony_ci-     Current:电池电流。
65fb726d48Sopenharmony_ci-     Capacity:电池容量。
66fb726d48Sopenharmony_ci-     APP Name:应用包名。
67fb726d48Sopenharmony_ci  Power Details 的 Tab 页如图:
68fb726d48Sopenharmony_ci  ![GitHub Logo](../../figures/HiSystemEvent/hisyseventPowerdetails.jpg)
69fb726d48Sopenharmony_ci-     UID: 应用UID。
70fb726d48Sopenharmony_ci-     Charge:充电状态。
71fb726d48Sopenharmony_ci-     Foreground Duration(ms):前台使用时长。
72fb726d48Sopenharmony_ci-     Foreground Energy(mAs):前台使用功耗值。
73fb726d48Sopenharmony_ci-     Background Duration(ms):后台使用时长。
74fb726d48Sopenharmony_ci-     Background Energy(mAs):后台使用功耗值。
75fb726d48Sopenharmony_ci-     Screen On Duration(ms):亮屏使用时长。
76fb726d48Sopenharmony_ci-     Screen On Energy(mAs):亮屏使用功耗值。
77fb726d48Sopenharmony_ci-     Screen Off Duration(ms):灭屏使用时长。
78fb726d48Sopenharmony_ci-     Screen Off Energy(mAs):灭屏使用功耗值。
79fb726d48Sopenharmony_ci-     Foreground Count:应用前台扫描次数。
80fb726d48Sopenharmony_ci-     Background Count:应用后台扫描次数。
81fb726d48Sopenharmony_ci-     Screen On Count:应用亮屏扫描次数。
82fb726d48Sopenharmony_ci-     Screen Off Count:应用灭屏扫描次数。
83fb726d48Sopenharmony_ci-     Background Time(ms):应用后台使用时长。
84fb726d48Sopenharmony_ci-     Screen On Time(ms):应用亮屏使用时长。
85fb726d48Sopenharmony_ci-     Screen Off Time(ms):应用灭屏使用时长。
86fb726d48Sopenharmony_ci-     Energy(mAs):功耗值。
87fb726d48Sopenharmony_ci-     Load(%):占用率。
88fb726d48Sopenharmony_ci-     Usage(ms):应用使用时长。
89fb726d48Sopenharmony_ci-     Duration(ms):持续时长。
90fb726d48Sopenharmony_ci-     Camera Id:Camera类型,0:后置,1:前置。
91fb726d48Sopenharmony_ci-     Count:应用个数。
92fb726d48Sopenharmony_ci-     Energy Percent(%):功耗占比。
93fb726d48Sopenharmony_ci
94fb726d48Sopenharmony_ci### HiSystemEvent 的 Hisysevent 泳道图展示
95fb726d48Sopenharmony_ci
96fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisystemeventrow.jpg)
97fb726d48Sopenharmony_ci
98fb726d48Sopenharmony_ci### HiSystemEvent 的 Hisysevent 泳道图框选功能
99fb726d48Sopenharmony_ci
100fb726d48Sopenharmony_ci框选 Hisysevent 的泳道图,展示 Hisysevents 的 tab 页,有 Filter by Domain,Filter by eventname,Filter by contents 输入框。All 下拉框可以选择 level 级别
101fb726d48Sopenharmony_ci![GitHub Logo](../../figures/HiSystemEvent/hisyseventtab.jpg)
102fb726d48Sopenharmony_ci
103fb726d48Sopenharmony_ci-     id: id值。
104fb726d48Sopenharmony_ci-     domain:domain值。
105fb726d48Sopenharmony_ci-     eventname:事件名。
106fb726d48Sopenharmony_ci-     type:事件类型。
107fb726d48Sopenharmony_ci-     time:时间戳信息。
108fb726d48Sopenharmony_ci-     pid:进程id。
109fb726d48Sopenharmony_ci-     tid:线程id。
110fb726d48Sopenharmony_ci-     uid:uid。
111fb726d48Sopenharmony_ci-     info:info信息。
112fb726d48Sopenharmony_ci-     level:事件级别。
113fb726d48Sopenharmony_ci-     seq:序列号。
114fb726d48Sopenharmony_ci-     contents:抓取内容。
115fb726d48Sopenharmony_ci  框选 Hisysevent 的泳道图,展示 Statistics 的 tab 页。
116fb726d48Sopenharmony_ci  ![GitHub Logo](../../figures/HiSystemEvent/hisyseventStatistics.jpg)
117fb726d48Sopenharmony_ci-     Level/Domain/EventName:根据级别,Domain,事件名显示。
118fb726d48Sopenharmony_ci-     Count: 各级别事件个数。
119