• Home
Name Date Size #Lines LOC

..--

adapter/07-Sep-2024-9,3336,924

base/07-Sep-2024-32,05223,370

build/07-Sep-2024-480395

core/07-Sep-2024-4,0843,018

figures/07-Sep-2024-

framework/native/unified_collection/07-Sep-2024-9,0846,878

interfaces/07-Sep-2024-2,5311,700

plugins/07-Sep-2024-41,89831,128

service/07-Sep-2024-999820

test/07-Sep-2024-5,5973,968

utility/07-Sep-2024-16,99415,636

.gitattributesD07-Sep-2024631 1615

.gitignoreD07-Sep-202443 32

BUILD.gnD07-Sep-20243.8 KiB155132

CODEOWNERSD07-Sep-20241.2 KiB2319

LICENSED07-Sep-202410.1 KiB178150

OAT.xmlD07-Sep-20247 KiB9138

README.mdD07-Sep-20243.5 KiB9253

README_zh.mdD07-Sep-20243.2 KiB9454

bundle.jsonD07-Sep-20246.7 KiB168167

hisysevent.yamlD07-Sep-20249.9 KiB217187

hiview.gniD07-Sep-20242.5 KiB7967

hiview_zh.mdD07-Sep-202423.6 KiB447339

hiviewdfx.yamlD07-Sep-20246.5 KiB12899

kernel_vendor.yamlD07-Sep-202419.4 KiB416370

main.cppD07-Sep-20241.7 KiB5427

README.md

1# Hiview<a name="EN-US_TOPIC_0000001162254005"></a>
2
3-   [Introduction](#section1289063163919)
4-   [Directory Structure](#section16611433113712)
5-   [Constraints](#section7147138193814)
6-   [Contribution](#section10404153013381)
7-   [Usage](#section1046874983819)
8-   [Repositories Involved](#section16647142611396)
9
10## Introduction<a name="section1289063163919"></a>
11
12Hiview is the module of OpenHarmony that provides toolkits for device maintenance across different platforms.
13
14Currently, Hiview opens only the plug-in management platform and system event source capabilities.
15
16**Figure 1**  Architecture of Hiview
17
18![](figures/en-us_image_0000001162020243.png)
19
20Hiview consists of the following components:
21
22adapter: operating system adaptation layer, which adapts APIs of the system services in use
23
24hiview base: Hiview base definition, which provides the plug-in definition, detector definition, and utility class
25
26hiview core: Hiview core module, which provides the plug-in configuration, plug-in management, and event source functions
27
28hiview services: Hiview services. Currently, only the Hiview run information exporting function is provided.
29
30plugins: Independent service modules.
31
32Hiview works in event-driven mode. The core of Hiview is a collection of HiSysEvent stubs distributed in the system.
33
34Formatted events are reported to Hiview through the  **HiSysEvent**  API for processing. Figure 2 shows the data interaction process.
35
36**Figure 2**  Data interaction between Hiview modules
37
38![](figures/en-us_image_0000001115710726.png)
39
401. The application framework and system services report system events using the  **HiSysEvent**  API.
41
422. HiSysEventSource reads events and prints the events to logs.
43
44## Directory Structure<a name="section16611433113712"></a>
45
46The code directory structure of Hiview is as follows:
47
48```
49/base/hiviewdfx/hiview
50├── adapter             # Platform adaptation code
51│   └── service        # Service adaptation code
52├── base                # Module definition and utility class
53│   └── utility
54├── build               # Compilation scripts
55├── include             # Common definitions
56├── core                # Plug-in management
57└── service             # Platform services
58```
59
60## Constraints<a name="section7147138193814"></a>
61
62Use of C++14 features requires libc of C++14 or later.
63
64## Contribution<a name="section10404153013381"></a>
65
66If you are interested in Hiview and want to become a contributor, refer to the  _Code Contribution Guide_.
67
68## Usage<a name="section1046874983819"></a>
69
70Hiview automatically starts with the device and loads plug-ins based on the configuration file.
71
72## Repositories Involved<a name="section16647142611396"></a>
73
74[DFX subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/dfx.md)
75
76**hiviewdfx\_hiview**
77
78[hiviewdfx\_hilog](https://gitee.com/openharmony/hiviewdfx_hilog/blob/master/README.md)
79
80[hiviewdfx\_hiappevent](https://gitee.com/openharmony/hiviewdfx_hiappevent/blob/master/README.md)
81
82[hiviewdfx\_hisysevent](https://gitee.com/openharmony/hiviewdfx_hisysevent/blob/master/README.md)
83
84[hiviewdfx\_faultloggerd](https://gitee.com/openharmony/hiviewdfx_faultloggerd/blob/master/README.md)
85
86[hiviewdfx\_hilog\_lite](https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/README.md)
87
88[hiviewdfx\_hievent\_lite](https://gitee.com/openharmony/hiviewdfx_hievent_lite/blob/master/README.md)
89
90[hiviewdfx\_hiview\_lite](https://gitee.com/openharmony/hiviewdfx_hiview_lite/blob/master/README.md)
91
92

README_zh.md

1# Hiview组件<a name="ZH-CN_TOPIC_0000001162254005"></a>
2
3-   [简介](#section1289063163919)
4-   [目录](#section16611433113712)
5-   [约束](#section7147138193814)
6-   [贡献](#section10404153013381)
7-   [使用](#section1046874983819)
8-   [相关仓](#section16647142611396)
9
10## 简介<a name="section1289063163919"></a>
11
12Hiview是一个跨平台的终端设备维测服务集。
13
14目前开源部分仅包含插件管理平台和系统事件源。
15
16**图1**.Hiview模块架构图
17
18![](figures/zh-cn_image_0000001162020243.png)
19
20Hiview由框架和插件组成,分别为:
21
22操作系统适配层\(adapter\),对使用的系统服务的接口进行适配。
23
24Hiview基础定义\(hiview base\),包括插件的定义,检测器的定义以及工具类。
25
26Hiview的核心模块\(hiview core\),包括插件配置,插件管理以及事件源。
27
28Hiview服务\(hiview services\),目前仅包括hiview运行信息导出功能。
29
30Hiview插件\(plugins\),为独立功能的业务模块。
31
32Hiview维测服务是由事件驱动的,其核心为分布在系统各处的HiSysEvent桩点。
33
34格式化的事件通过HiSysEvent API上报至hiview进行处理,其基本流程如图2。
35
36**图2**.Hiview模块数据交互图
37
38![](figures/zh-cn_image_0000001115710726.png)
39
401.应用框架、系统服务使用HiSysEvent组件上报系统事件信息。
41
422.Hiview中HiSysEventSource读取事件,并打印到流水日志中。
43
44## 目录<a name="section16611433113712"></a>
45
46Hiview源代码目录结构如下:
47
48```
49/base/hiviewdfx/hiview.
50├── adapter             #平台适配
51│   └── service        #服务适配
52├── base                #模块定义,工具类
53│   └── utility
54├── build               #编译脚本
55├── include             #公共定义
56├── core                #插件管理
57└── service             #平台服务
58```
59
60## 约束<a name="section7147138193814"></a>
61
62使用C++14的特性,依赖C++14及以上的libc实现。
63
64## 贡献<a name="section10404153013381"></a>
65
66如果您对Hiview感兴趣并想加入Hiview的开发并成为代码贡献者,请参考代码贡献指南。
67
68## 使用<a name="section1046874983819"></a>
69
70Hiview服务随设备启动自动启动,按配置文件加载插件。
71
72详细使用见[HiView插件开发指导](hiview_zh.md)
73
74## 相关仓<a name="section16647142611396"></a>
75
76[DFX子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/DFX%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
77
78**hiviewdfx\_hiview**
79
80[hiviewdfx\_hilog](https://gitee.com/openharmony/hiviewdfx_hilog/blob/master/README_zh.md)
81
82[hiviewdfx\_hiappevent](https://gitee.com/openharmony/hiviewdfx_hiappevent/blob/master/README_zh.md)
83
84[hiviewdfx\_hisysevent](https://gitee.com/openharmony/hiviewdfx_hisysevent/blob/master/README_zh.md)
85
86[hiviewdfx\_faultloggerd](https://gitee.com/openharmony/hiviewdfx_faultloggerd/blob/master/README_zh.md)
87
88[hiviewdfx\_hilog\_lite](https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/README_zh.md)
89
90[hiviewdfx\_hievent\_lite](https://gitee.com/openharmony/hiviewdfx_hievent_lite/blob/master/README_zh.md)
91
92[hiviewdfx\_hiview\_lite](https://gitee.com/openharmony/hiviewdfx_hiview_lite/blob/master/README_zh.md)
93
94