1# HiDumper Development 2 3 4## Overview 5 6 7### Introduction 8 9HiDumper 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. 10 11 12### Source Code Directories 13 14 15``` 16/base/hiviewdfx/hidumper 17├── frameworks # Framework code 18│ ├── native # Core function code 19│ │ │── include # Header files 20│ │ │── src # Source files 21│ │ │── common # Common function code 22│ │ │── executor # Process executor code 23│ │ │── factory # Factory code 24│ │ │── manager # Core manager code 25│ │ │── util # Utility source code 26│── sa_profile # HiDumper SA profile 27│── services # HiDumper service code 28│ │── native # C++ service code 29│ │── zidl # Communication function 30│ │ │── include # Header files of the communication function 31│ │ │── src # Source code of the communication function 32├── test # Test cases 33│ ├── unittest # Unit test code 34│ ├── moduletest # Module-level test code 35``` 36 37 38## Usage 39 40 41### Command-Line Options 42 43 **Table 1** HiDumper command-line options 44 45| Option| **Description**| 46| -------- | -------- | 47| -h | Shows the help Information.| 48| -t [timeout] | Specifies the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit.| 49| -lc | Shows the system information cluster list.| 50| -ls | Shows the system ability list.| 51| -c | Exports system cluster information.| 52| -c [base system] | Exports system cluster information based on **base** or **system** tags.| 53| -s | Exports all system ability information.| 54| -s [SA0 SA1] | Exports ability information corresponding to SA0 and SA1.| 55| -s [SA] -a ['-h'] | Exports the system ability information **SA** using the **-h** parameter.| 56| -e | Exports crash logs generated by the Faultlogger module.| 57| --net | Exports network information.| 58| --storage | Exports storage information.| 59| -p | Exports the process list and all process information.| 60| -p [pid] | Exports all information about a specified process.| 61| --cpuusage [pid] | Exports the CPU usage information based on **pid**.| 62| --cpufreq | Exports the actual CPU frequency.| 63| --mem [pid] | Exports the memory usage information based on **pid**.| 64| --zip | Compresses the exported information to a specified folder.| 65 66 67### Development Example 68 69HiDumper 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. 70 71The procedure is as follows: 72 731. Access the device CLI, and run the **hidumper -h** command to obtain the help information, which includes basic information and function syntax. 74 75 ``` 76 hidumper -h 77 ``` 78 792. Run the **hidumper -lc** command to obtain the system information cluster list. 80 81 ``` 82 hidumper -lc 83 ``` 84 853. Run the **hidumper -c** command to obtain all information that is classified by **base** and **system**. 86 87 ``` 88 hidumper -c 89 ``` 90 914. Run the **hidumper -c [base | system]** to obtain the system cluster information that is classified by **base** or **system**. 92 93 ``` 94 hidumper -c base 95 hidumper -c system 96 ``` 97 985. Run the **hidumper -ls** command to obtain the system ability list. 99 100 ``` 101 hidumper -ls 102 ``` 103 1046. Run the **hidumper -s** command to obtain all system ability information. 105 106 ``` 107 hidumper -s 108 ``` 109 1107. Run the **hidumper -s 3301 -a "-h"** command to obtain the help information about the ability whose ID is **3301**. 111 112 ``` 113 hidumper -s 3301 -a "-h" 114 ``` 115 1168. Run the **hidumper -s 3008** command to obtain all information about the ability whose ID is **3008**. 117 118 ``` 119 hidumper -s 3008 120 ``` 121 1229. Run the **hidumper -e** command to obtain the crash information generated by the Faultlog module. 123 124 ``` 125 hidumper -e 126 ``` 127 12810. Run the **hidumper --net** command to obtain network information. 129 130 ``` 131 hidumper --net 132 ``` 133 13411. Run the **hidumper --storage** command to obtain storage information. 135 136 ``` 137 hidumper --storage 138 ``` 139 14012. Run the **hidumper -p** command to obtain process information, including the list and information of processes and threads. 141 142 ``` 143 hidumper -p 144 ``` 145 14613. Run the **hidumper -p 1024** command to obtain information about the process whose PID is **1024**. 147 148 ``` 149 hidumper -p 1024 150 ``` 151 15214. Run the **hidumper --cpuusage [pid]** command to obtain the CPU usage information of the process whose PID has been specified. 153 154 ``` 155 hidumper --cpuusage 156 hidumper --cpuusage 1024 157 ``` 158 15915. Run the **hidumper --cpufreq** command to obtain the actual operating frequency of each CPU core. 160 161 ``` 162 hidumper --cpufreq 163 ``` 164 16516. Run the **hidumper --mem [pid]** command to obtain all memory usage information of the process whose PID has been specified. 166 167 ``` 168 hidumper --mem [pid] 169 ``` 170 17117. Run the **hidumper --zip** command to compress data to the **/data/dumper** directory. 172 173 ``` 174 hidumper --zip 175 ``` 176 17718. Run the **hidumper -t timeout** command to set the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit. 178 179 ``` 180 hidumper -t [timeout] 181 ``` 182