• Home
Name Date Size #Lines LOC

..--

client/native/12-May-2024-10771

figures/12-May-2024-

frameworks/native/12-May-2024-13,66210,405

interfaces/12-May-2024-716449

sa_profile/12-May-2024-4946

services/12-May-2024-3,2402,676

test/12-May-2024-2,9331,976

utils/12-May-2024-190119

.gitattributesD12-May-2024798 2019

BUILD.gnD12-May-2024939 2926

CODEOWNERSD12-May-2024847 1917

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-20244.1 KiB6816

README.mdD12-May-20245.8 KiB179124

README_zh.mdD12-May-20245.7 KiB186126

bundle.jsonD12-May-20242.9 KiB9392

hidumper.gniD12-May-20242.1 KiB6651

README.md

1# HiDumper<a name="EN-US_TOPIC_0000001116225437"></a>
2
3  - [Introduction](#section11660541593)
4  - [Directory Structure](#section161941989596)
5  - [Usage](#section1312121216216)
6    - [How to Use](#section129654513264)
7  - [Repositories Involved](#section1371113476307)
8
9## Introduction<a name="section11660541593"></a>
10
11HiDumper is a unified system information collection tool provided by OpenHarmony for development and test personnel to analyze and locate faults.
12
13HiDumper consists of the following modules:
14
15-   hidumper: Serves as the executable program of HiDumper, which receives user input and communicates with the server.
16-   DumpManager: Serves as the manager of HiDumper, which provides functions such as information classification, command request distribution, and information collection.
17-   Dumpers: Exports various information, including file information, command information, CPU usage, and memory usage.
18-   Output: Outputs various contents. This module consists of two parts: FdOutput for standard output or file output and ZipOutput for compressed output.
19
20**Figure 1** HiDumper architecture
21
22![](figures/en-us_image_0000001116226343.png)
23
24## Directory Structure<a name="section161941989596"></a>
25
26```
27/base/hiviewdfx/hidumper
28├── client                # Client code
29│   ├── native            # Native code
30├── frameworks            # Framework code
31│   ├── native            # Core function code
32|   |   |── include        # Header files
33|   |   |── src           # Source files
34|   |       |── common    # Common function code
35|   |       |── executor  # Process executor code
36|   |       |── factory   # Factory code
37|   |       |── manager   # Core manager code
38|   |       |── util      # Utility code
39|── sa_profile            # HiDumper SA profile
40|── services              # HiDumper service code
41|   |── native            # C++ service code
42|   |── zidl              # Communication function
43|   |   |── include       # Header files of the communication function
44|   |   |── src           # Source code of the communication function
45├── test                  # Test cases
46│   ├── unittest          # Unit test code
47│   ├── moduletest        # Module-level test code
48```
49
50## Usage<a name="section1312121216216"></a>
51
52During OpenHarmony application development, you can use HiDumper to query system information, service information, and process stack information, and then use the information to analyze and locate faults.
53
54
55### How to Use<a name="section129654513264"></a>
56
57HiDumper helps you export basic system information to locate and analyze faults. When passing complex parameters to sub-services and abilities, enclose parameters in double quotation marks.
58
59The procedure is as follows:
60
611.  Access the device CLI, and run the **hidumper -h** command to obtain the help information, which includes basic information and function syntax.
62
63    ```
64    hidumper -h
65    ```
66
672.  Run the **hidumper -lc** command to obtain the system information cluster list.
68
69    ```
70    hidumper -lc
71    ```
72
733.  Run the **hidumper -c** command to obtain all information that is classified by **base** and **system**.
74
75    ```
76    hidumper -c
77    ```
78
794.  Run the **hidumper -c [base | system]** to obtain the system cluster information that is classified by **base** or **system**.
80
81    ```
82    hidumper -c base
83    hidumper -c system
84    ```
85
865.  Run the **hidumper -ls** command to obtain the system ability list.
87
88    ```
89    hidumper -ls
90    ```
91
926.  Run the **hidumper -s** command to obtain all system ability information.
93
94    ```
95    hidumper -s
96    ```
97
987.  Run the **hidumper -s 3301 -a "-h"** command to obtain the help information about the ability whose ID is **3301**.
99
100    ```
101    hidumper -s 3301  -a "-h"
102    ```
103
1048.  Run the **hidumper -s 3008** command to obtain all information about the ability whose ID is **3008**.
105
106    ```
107    hidumper -s 3008
108    ```
109
1109.  Run the **hidumper -e** command to obtain the crash information generated by the Faultlog module.
111
112    ```
113    hidumper -e
114    ```
115
11610. Run the **hidumper --net** command to obtain network information.
117
118    ```
119    hidumper --net
120    ```
121
12211. Run the **hidumper --storage** command to obtain storage information.
123
124    ```
125    hidumper --storage
126    ```
12712. Run the **hidumper -p** command to obtain process information, including the list and information of processes and threads.
128
129    ```
130    hidumper -p
131    ```
132
13313. Run the **hidumper -p 1024** command to obtain information about the process whose PID is **1024**.
134
135    ```
136    hidumper -p 1024
137    ```
138
13914. Run the **hidumper --cpuusage [pid]** command to obtain the CPU usage information of the process whose PID has been specified.
140
141    ```
142    hidumper --cpuusage
143    hidumper --cpuusage 1024
144    ```
145
14615. Run the **hidumper --cpufreq** command to obtain the actual operating frequency of each CPU core.
147
148    ```
149    hidumper --cpufreq
150    ```
151
15216. Run the **hidumper --mem [pid]** command to obtain all memory usage information of the process whose PID has been specified.
153
154    ```
155    hidumper --mem
156    hidumper --mem 1024
157    ```
158
15917. Run the **hidumper --zip** command to compress data to the **/data/log/hidumper** directory.
160
161    ```
162    hidumper --zip
163    ```
164
16518. Run the **hidumper --mem-smaps pid [-v]** The pid parameter is mandatory.Run the following command to query the detailed memory usage of a specified process.
166
167    ```
168    hidumper --zip
169    ```
170
171## Repositories Involved<a name="section1371113476307"></a>
172
173[DFX Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/dfx.md)
174
175[hiviewdfx_hilog](https://gitee.com/openharmony/hiviewdfx_hilog/blob/master/README.md)
176
177[hiviewdfx_faultloggerd](https://gitee.com/openharmony/hiviewdfx_faultloggerd/blob/master/README.md)
178
179[hiviewdfx_hidumper](https://gitee.com/openharmony/hiviewdfx_hidumper/blob/master/README.md)

README_zh.md

1# HiDumper组件<a name="ZH-CN_TOPIC_0000001116225437"></a>
2
3
4- [HiDumper组件<a name="ZH-CN_TOPIC_0000001116225437"></a>](#hidumper组件)
5  - [简介<a name="section11660541593"></a>](#简介)
6  - [目录<a name="section161941989596"></a>](#目录)
7  - [说明<a name="section1312121216216"></a>](#说明)
8    - [接口说明<a name="section1551164914237"></a>](#接口说明)
9    - [使用说明<a name="section129654513264"></a>](#使用说明)
10  - [相关仓<a name="section1371113476307"></a>](#相关仓)
11
12
13## 简介<a name="section11660541593"></a>
14
15HiDumper是OpenHarmony中为开发、测试人员,IDE工具提供统一的系统信息获取工具,帮助使用者分析,定位问题。
16
17HiDumper主要包括以下几个主要模块:
18
19-   hidumper,hidumper工具的可执行程序,接收用户输入,与服务端通讯。
20-   DumpManager,系统信息导出工具管理者,提供信息分类,命令请求分发和信息获取方法的管理。
21-   Dumpers,各类信息的导出器。主要包括文件导出、命令导出、CPU使用导出、内存使用导出等。
22-   Output,内容输出,主要包括向标准输出或文件输出的FdOutput,压缩输出的ZipOutput。
23
24**图1**  HiDumper架构图
25
26![](figures/zh-cn_image_0000001116226343.png)
27
28## 目录<a name="section161941989596"></a>
29
30```
31/base/hiviewdfx/hidumper
32├── client                # 客户端代码
33│   ├── native            # 客户端native代码
34├── frameworks            # 框架代码
35│   ├── native            # 导出功能核心代码
36|   |   |── include        # 头文件目录
37|   |   |── src           # 源文件目录
38|   |       |── common    # 通用功能代码
39|   |       |── executor  # 导出过程执行器代码
40|   |       |── factory   # 跟进导出项生成导出执行器
41|   |       |── manager   # 导出管理核心代码
42|   |       |── util      # 工具类源代码
43|── sa_profile            # Hidumper sa 属性文件
44|── services              # Hidumper服务源码
45|   |── native            # 服务C++源码
46|   |── zidl              # 通讯功能源码目录
47|   |   |── include       # 通讯功能头文件
48|   |   |── src           # 通讯功能源代码
49├── test                  # 测试用例目录
50│   ├── unittest          # 单元测试代码
51│   ├── moduletest        # 模块级别测试代码
52```
53
54## 说明<a name="section1312121216216"></a>
55
56开发者在OpenHarmony应用开发过程中需要查询系统信息,服务信息,进程栈等信息时可以通过HiDumper获取到对应信息,然后利用这些信息分析定位问题。
57
58
59### 使用说明<a name="section129654513264"></a>
60
61hidumper可以为开发者导出系统当前基本信息,通过这些基本信息可以定位分析问题。给子服务和元能力传递复杂参数时,参数需要在双引号中。
62
63具体步骤如下:
64
651.  进入设备命令行,输入hidumper -h获取基本信息介绍,功能语法介绍。
66
67    ```
68    hidumper -h
69    ```
70
712.  输入hidumper -lc获取系统信息分类列表。
72
73    ```
74    hidumper -lc
75    ```
76
773.  输入hidumper -c 获取系统base、system等所有分类信息。
78
79    ```
80    hidumper -c
81    ```
82
834.  输入  **hidumper -c [base system]**  按  **base** 或 **system** 分类获取系统簇信息。
84
85    ```
86    hidumper -c base
87    hidumper -c system
88    ```
89
905.  输入  **hidumper -ls**  命令获取系统中元能力列表。
91
92    ```
93    hidumper -ls
94    ```
95
966.  输入  **hidumper -s**  命令获取系统全部元能力信息。
97
98    ```
99    hidumper -s
100    ```
101
1027.  运行  **hidumper -s 3301 -a "-h"**  命令获取id为3301的元能力的帮助。
103
104    ```
105    hidumper -s 3301  -a "-h"
106    ```
107
1088.  运行  **hidumper -s 3008**  命令获取id为3008的元能力的全部信息。
109
110    ```
111    hidumper -s 3008
112    ```
113
1149.  运行  **hidumper -e**  命令获取Faultlog模块生成的崩溃历史信息。
115
116    ```
117    hidumper -e
118    ```
119
12010. 运行  **hidumper --net**  命令获取网络信息。
121
122    ```
123    hidumper --net
124    ```
125
12611. 运行  **hidumper --storage**  命令获取存储相关信息。
127
128    ```
129    hidumper --storage
130    ```
13112. 运行  **hidumper -p**  命令获取进程信息,包括进程、线程的列表和信息。
132
133    ```
134    hidumper -p
135    ```
136
13713. 运行  **hidumper -p 1024**  命令获取pid为1024的进程信息。
138
139    ```
140    hidumper -p 1024
141    ```
142
14314. 运行  **hidumper --cpuusage [pid]**  命令获取CPU的使用信息;如果指定了进程的pid,则只获取该进程的CPU使用信息。
144
145    ```
146    hidumper --cpuusage
147    hidumper --cpuusage 1024
148    ```
149
15015. 运行  **hidumper --cpufreq**  命令获取每一个CPU核实际运行的频率。
151
152    ```
153    hidumper --cpufreq
154    ```
155
15616. 运行  **hidumper --mem [pid]**  命令获取全部的内存使用信息;如果指定进程的pid,只获取该进程的内存使用情况。
157
158    ```
159    hidumper --mem
160    hidumper --mem 1024
161    ```
162
16317. 运行  **hidumper --zip**  命令压缩信息数据到/data/log/hidumper目录下。
164
165    ```
166    hidumper --zip
167    ```
168
16918. 运行  **hidumper --mem-smaps pid [-v]**  pid 必选参数。命令获取指定进程内存信息的详细使用情况。
170
171    ```
172    hidumper --mem-smaps pid [-v]
173    ```
174
175
176## 相关仓<a name="section1371113476307"></a>
177
178
179[DFX子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/DFX子系统.md)
180
181[hiviewdfx_hilog](https://gitee.com/openharmony/hiviewdfx_hilog/blob/master/README_zh.md)
182
183[hiviewdfx_faultloggerd](https://gitee.com/openharmony/hiviewdfx_faultloggerd/blob/master/README_zh.md)
184
185[hiviewdfx_hidumper](https://gitee.com/openharmony/hiviewdfx_hidumper/blob/master/README_zh.md)
186