• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# HiDumper
2
3
4## Overview
5
6HiDumper is a tool provided by OpenHarmony for developers, testers, and IDE tool engineers to obtain system information necessary for analyzing and locating faults. This section applies only to the standard system.
7
8## Source Code Directories
9
10
11```
12/base/hiviewdfx/hidumper
13├── frameworks           # Framework code
14│   ├── native           # Core function code
15│   │  │── include       # Header files
16│   │  │── src           # Source files
17│   │      │── common    # Common function code
18│   │      │── executor  # Process executor code
19│   │      │── factory   # Factory code
20│   │      │── manager   # Core manager code
21│   │      │── util      # Utility source code
22│── sa_profile           # HiDumper SA profile
23│── services             # HiDumper service code
24│   │── native           # C++ service code
25│   │── zidl             # Communication function
26│   │   │── include      # Header files of the communication function
27│   │   │── src          # Source code of the communication function
28├── test                 # Test cases
29│   ├── unittest         # Unit test code
30│   ├── moduletest       # Module-level test code
31```
32
33
34# Usage
35
36
37## Command-Line Options
38
39  **Table 1** HiDumper command-line options
40
41| Option| **Description**|
42| -------- | -------- |
43| -h | Shows the help Information.|
44| -t [timeout] | Specifies the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit.|
45| -lc | Shows the system information cluster list.|
46| -ls | Shows the system ability list.|
47| -c | Exports system cluster information.|
48| -c [base system] | Exports system cluster information based on **base** or **system** tags.|
49| -s | Exports all system ability information.|
50| -s [SA0 SA1] | Exports ability information corresponding to SA0 and SA1.|
51| -s [SA] -a ['-h'] | Exports the system ability information **SA** using the **-h** parameter.|
52| -e | Exports crash logs generated by the FaultLogger module.|
53| --net | Exports network information.|
54| --storage | Exports storage information.|
55| -p | Exports the process list and all process information.|
56| -p [pid] | Exports all information about the specified process.|
57| --cpuusage [pid] | Exports the CPU usage information. If **pid** is specified, the CPU usage of the corresponding process is exported.|
58| --cpufreq | Exports the actual CPU frequency.|
59| --mem [pid] | Export memory usage information. If **pid** is specified, the memory usage of the corresponding process is exported.|
60| --zip | Compresses the exported information to a specified folder.|
61
62
63## Development Example
64
65HiDumper helps you export basic system information to locate and analyze faults. Complex parameters passed to sub-services and abilities must be enclosed in double quotation marks.
66
67The procedure is as follows:
68
691. Access the device CLI, and run the **hidumper -h** command to obtain the help information, which includes basic information and function syntax.
70
71   ```
72   hidumper -h
73   ```
74
752. Run the **hidumper -lc** command to obtain the system information cluster list.
76
77   ```
78   hidumper -lc
79   ```
80
813. Run the **hidumper -c** command to obtain all information that is classified by **base** and **system**.
82
83   ```
84   hidumper -c
85   ```
86
874. Run the **hidumper -c [base | system]** to obtain the system cluster information that is classified by **base** or **system**.
88
89   ```
90   hidumper -c base
91   hidumper -c system
92   ```
93
945. Run the **hidumper -ls** command to obtain the system ability list.
95
96   ```
97   hidumper -ls
98   ```
99
1006. Run the **hidumper -s** command to obtain all system ability information.
101
102   ```
103   hidumper -s
104   ```
105
1067. Run the **hidumper -s 3301 -a "-h"** command to obtain the help information about the ability whose ID is **3301**.
107
108   ```
109   hidumper -s 3301 -a "-h"
110   ```
111
1128. Run the **hidumper -s 3008** command to obtain all information about the ability whose ID is **3008**.
113
114   ```
115   hidumper -s 3008
116   ```
117
1189. Run the **hidumper -e** command to obtain the crash information generated by the FaultLoger module.
119
120   ```
121   hidumper -e
122   ```
123
12410. Run the **hidumper --net** command to obtain network information.
125
126    ```
127    hidumper --net
128    ```
129
13011. Run the **hidumper --storage** command to obtain storage information.
131
132    ```
133    hidumper --storage
134    ```
135
13612. Run the **hidumper -p** command to obtain process information, including the list and information of processes and threads.
137
138    ```
139    hidumper -p
140    ```
141
14213. Run the **hidumper -p 1024** command to obtain information about the process whose PID is **1024**.
143
144    ```
145    hidumper -p 1024
146    ```
147
14814. Run the **hidumper  --cpuusage [pid]** command to obtain the CPU usage information. If the PID of a process is specified, only the CPU usage of the process is returned.
149
150    ```
151    hidumper --cpuusage
152    hidumper --cpuusage 1024
153    ```
154
15515. Run the **hidumper --cpufreq** command to obtain the actual operating frequency of each CPU core.
156
157    ```
158    hidumper --cpufreq
159    ```
160
16116. Run the **hidumper --mem [pid]** command to obtain all memory usage information. If the PID of a process is specified, only the memory usage of the process is returned.
162
163    ```
164    hidumper --mem [pid]
165    ```
166
16717. Run the **hidumper --zip** command to compress data to the **/data/dumper** directory.
168
169    ```
170    hidumper --zip
171    ```
172
17318. Run the **hidumper -t timeout** command to set the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit.
174
175    ```
176    hidumper -t [timeout]
177    ```
178