1# hiviewdfx_hidumper_lite 2 3- [Introduction](#Introduction) 4- [Directory Structure](#Directory Structure) 5- [Use of hidumper_lite](#Use of hidumper_lite) 6- [System Interface](#System Interface) 7- [Rewrite interface](#Rewrite interface) 8- [Related warehouses](#Related warehouses) 9 10## Introduction 11 12The hidumper_lite provides dump interfaces in the LiteOS_M system to help developers export fault logs, memory, and CPU information. 13 14## Directory Structure 15 16The source of Hiview code directory structure is as follows:: 17 18``` 19/base/hiviewdfx/hidumper_lite. 20├── lite 21 └── hidumper.c #AT命令处理过程 22└── mini 23 ├── hidumper_adapter.c #hidumper功能函数适配层 24 ├── hidumper_core.c #hidumper核心层 25 └── interfaces #公共接口文件 26 27``` 28 29## Use of hidumper_lite 30 31The hidumper_lite command is used to query data in the liteOS_M 32 33Parameter: 34 | Format | Meaning | 35 | -------- | -------- | 36 | AT+HIDUMPER= | Displays the CPU, memory, and all task usage information | 37 | AT+HIDUMPER=-dc | Displays CPU usage information | 38 | AT+HIDUMPER=-dm | Displays memory usage information | 39 | AT+HIDUMPER=-df | Print the last fault log information | 40 | AT+HIDUMPER=-dt | Print all task information | 41 | AT+HIDUMPER=-h | Print the help information | 42 | AT+HIDUMPER=-ikc | Injecting faults into the kernel | 43 | AT+HIDUMPER=-m | Prints all memory data in hexadecimal format | 44 | AT+HIDUMPER=-m,memstart,memsize | Prints the data of a specific memory area in hexadecimal format. Two parameters, 45 memstart: Memory start address. memsize: memory size | 46 47## System Interface 48 49### at_hidumper 50 51``` 52int at_hidumper(unsigned int argc, const char **argv) 53``` 54 55AT instruction processing function injected into the system 56 57- Parameter: 58 | Member | Type | Required | Description 59 | -------- | -------- | -------- | -------- | 60 | argc | unsigned int | Y | number of Parameter | 61 | argv | const char** | Y | content of Parameter | 62 63 64## Rewrite interface 65 66For details about the example, see the rewriting of the hi3861 chip. The corresponding position is as follows device/soc/hisilicon/hi3861v100/sdk_liteos/components/at/src/hidumper_adapter_impl.c 67 68The following functions are : that need to be rewritten on different chips. 69 70### DumpSysInfo 71 72``` 73int DumpSysInfo(void); 74``` 75 76Rewrites the function of printing system information. This function prints the system information of the current device. 77 78### DumpCpuUsage 79 80``` 81int DumpCpuUsage(void); 82``` 83 84Rewrites the function for printing CPU usage information. This function prints the CPU usage of the current device. 85 86### DumpMemUsage 87 88``` 89int DumpMemUsage(void); 90``` 91 92Rewrites the function for printing memory usage information. This function prints the memory usage of the current device. 93 94### DumpTaskInfo 95 96``` 97int DumpTaskInfo(void); 98``` 99 100Rewrite the function of printing all task information of the system. This function prints all task information in the system. 101 102### DumpFaultLog 103 104``` 105int DumpFaultLog(void); 106``` 107 108Rewrite the function for printing exception logs. This function prints the last saved log information. 109 110### DumpMemRegion 111 112``` 113int DumpMemRegion(unsigned long long addr, unsigned long long size) 114``` 115 116Overwrites the function of printing memory data in a specified area. This function prints the data of the memory area of the total size starting from addr. 117 118- Parameter: 119 |Parameter name|Type|Mandatory|Description 120 | -------- | -------- | -------- | -------- | 121 | addr | unsigned long long | Y | Start address of the memory to be queried | 122 | size | unsigned long long | Y | Internal size to be queried | 123 124### DumpAllMem 125 126``` 127int DumpAllMem(void); 128``` 129 130Overwrites the function of printing all memory data. This function can print all memory data. 131 132### PlatformHiDumperIinit 133 134``` 135int PlatformHiDumperIinit(void); 136``` 137 138Rewrites the platform hidumper initialization function. This function initializes features such as the at command of HiDumper based on different platforms. 139 140## Related warehouses 141 142[Subsystem of DFX](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/DFX%E5%AD%90%E7%B3%BB%E7%BB%9F.md) 143 144**hiviewdfx\_hidumper\_lite** 145 146[hiviewdfx\_blackbox](https://gitee.com/openharmony/hiviewdfx_blackbox/blob/master/README_zh.md) 147 148[hiviewdfx\_hilog\_lite](https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/README_zh.md) 149 150[hiviewdfx\_hievent\_lite](https://gitee.com/openharmony/hiviewdfx_hievent_lite/blob/master/README_zh.md) 151 152[hiviewdfx\_hiview\_lite](https://gitee.com/openharmony/hiviewdfx_hiview_lite/blob/master/README_zh.md) 153