155c6b4c7Sopenharmony_ci# hiviewdfx_hidumper_lite 255c6b4c7Sopenharmony_ci 355c6b4c7Sopenharmony_ci- [Introduction](#Introduction) 455c6b4c7Sopenharmony_ci- [Directory Structure](#Directory Structure) 555c6b4c7Sopenharmony_ci- [Use of hidumper_lite](#Use of hidumper_lite) 655c6b4c7Sopenharmony_ci- [System Interface](#System Interface) 755c6b4c7Sopenharmony_ci- [Rewrite interface](#Rewrite interface) 855c6b4c7Sopenharmony_ci- [Related warehouses](#Related warehouses) 955c6b4c7Sopenharmony_ci 1055c6b4c7Sopenharmony_ci## Introduction 1155c6b4c7Sopenharmony_ci 1255c6b4c7Sopenharmony_ciThe hidumper_lite provides dump interfaces in the LiteOS_M system to help developers export fault logs, memory, and CPU information. 1355c6b4c7Sopenharmony_ci 1455c6b4c7Sopenharmony_ci## Directory Structure 1555c6b4c7Sopenharmony_ci 1655c6b4c7Sopenharmony_ciThe source of Hiview code directory structure is as follows:: 1755c6b4c7Sopenharmony_ci 1855c6b4c7Sopenharmony_ci``` 1955c6b4c7Sopenharmony_ci/base/hiviewdfx/hidumper_lite. 2055c6b4c7Sopenharmony_ci├── lite 2155c6b4c7Sopenharmony_ci └── hidumper.c #AT命令处理过程 2255c6b4c7Sopenharmony_ci└── mini 2355c6b4c7Sopenharmony_ci ├── hidumper_adapter.c #hidumper功能函数适配层 2455c6b4c7Sopenharmony_ci ├── hidumper_core.c #hidumper核心层 2555c6b4c7Sopenharmony_ci └── interfaces #公共接口文件 2655c6b4c7Sopenharmony_ci 2755c6b4c7Sopenharmony_ci``` 2855c6b4c7Sopenharmony_ci 2955c6b4c7Sopenharmony_ci## Use of hidumper_lite 3055c6b4c7Sopenharmony_ci 3155c6b4c7Sopenharmony_ciThe hidumper_lite command is used to query data in the liteOS_M 3255c6b4c7Sopenharmony_ci 3355c6b4c7Sopenharmony_ciParameter: 3455c6b4c7Sopenharmony_ci | Format | Meaning | 3555c6b4c7Sopenharmony_ci | -------- | -------- | 3655c6b4c7Sopenharmony_ci | AT+HIDUMPER= | Displays the CPU, memory, and all task usage information | 3755c6b4c7Sopenharmony_ci | AT+HIDUMPER=-dc | Displays CPU usage information | 3855c6b4c7Sopenharmony_ci | AT+HIDUMPER=-dm | Displays memory usage information | 3955c6b4c7Sopenharmony_ci | AT+HIDUMPER=-df | Print the last fault log information | 4055c6b4c7Sopenharmony_ci | AT+HIDUMPER=-dt | Print all task information | 4155c6b4c7Sopenharmony_ci | AT+HIDUMPER=-h | Print the help information | 4255c6b4c7Sopenharmony_ci | AT+HIDUMPER=-ikc | Injecting faults into the kernel | 4355c6b4c7Sopenharmony_ci | AT+HIDUMPER=-m | Prints all memory data in hexadecimal format | 4455c6b4c7Sopenharmony_ci | AT+HIDUMPER=-m,memstart,memsize | Prints the data of a specific memory area in hexadecimal format. Two parameters, 4555c6b4c7Sopenharmony_ci memstart: Memory start address. memsize: memory size | 4655c6b4c7Sopenharmony_ci 4755c6b4c7Sopenharmony_ci## System Interface 4855c6b4c7Sopenharmony_ci 4955c6b4c7Sopenharmony_ci### at_hidumper 5055c6b4c7Sopenharmony_ci 5155c6b4c7Sopenharmony_ci``` 5255c6b4c7Sopenharmony_ciint at_hidumper(unsigned int argc, const char **argv) 5355c6b4c7Sopenharmony_ci``` 5455c6b4c7Sopenharmony_ci 5555c6b4c7Sopenharmony_ciAT instruction processing function injected into the system 5655c6b4c7Sopenharmony_ci 5755c6b4c7Sopenharmony_ci- Parameter: 5855c6b4c7Sopenharmony_ci | Member | Type | Required | Description 5955c6b4c7Sopenharmony_ci | -------- | -------- | -------- | -------- | 6055c6b4c7Sopenharmony_ci | argc | unsigned int | Y | number of Parameter | 6155c6b4c7Sopenharmony_ci | argv | const char** | Y | content of Parameter | 6255c6b4c7Sopenharmony_ci 6355c6b4c7Sopenharmony_ci 6455c6b4c7Sopenharmony_ci## Rewrite interface 6555c6b4c7Sopenharmony_ci 6655c6b4c7Sopenharmony_ciFor 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 6755c6b4c7Sopenharmony_ci 6855c6b4c7Sopenharmony_ciThe following functions are : that need to be rewritten on different chips. 6955c6b4c7Sopenharmony_ci 7055c6b4c7Sopenharmony_ci### DumpSysInfo 7155c6b4c7Sopenharmony_ci 7255c6b4c7Sopenharmony_ci``` 7355c6b4c7Sopenharmony_ciint DumpSysInfo(void); 7455c6b4c7Sopenharmony_ci``` 7555c6b4c7Sopenharmony_ci 7655c6b4c7Sopenharmony_ciRewrites the function of printing system information. This function prints the system information of the current device. 7755c6b4c7Sopenharmony_ci 7855c6b4c7Sopenharmony_ci### DumpCpuUsage 7955c6b4c7Sopenharmony_ci 8055c6b4c7Sopenharmony_ci``` 8155c6b4c7Sopenharmony_ciint DumpCpuUsage(void); 8255c6b4c7Sopenharmony_ci``` 8355c6b4c7Sopenharmony_ci 8455c6b4c7Sopenharmony_ciRewrites the function for printing CPU usage information. This function prints the CPU usage of the current device. 8555c6b4c7Sopenharmony_ci 8655c6b4c7Sopenharmony_ci### DumpMemUsage 8755c6b4c7Sopenharmony_ci 8855c6b4c7Sopenharmony_ci``` 8955c6b4c7Sopenharmony_ciint DumpMemUsage(void); 9055c6b4c7Sopenharmony_ci``` 9155c6b4c7Sopenharmony_ci 9255c6b4c7Sopenharmony_ciRewrites the function for printing memory usage information. This function prints the memory usage of the current device. 9355c6b4c7Sopenharmony_ci 9455c6b4c7Sopenharmony_ci### DumpTaskInfo 9555c6b4c7Sopenharmony_ci 9655c6b4c7Sopenharmony_ci``` 9755c6b4c7Sopenharmony_ciint DumpTaskInfo(void); 9855c6b4c7Sopenharmony_ci``` 9955c6b4c7Sopenharmony_ci 10055c6b4c7Sopenharmony_ciRewrite the function of printing all task information of the system. This function prints all task information in the system. 10155c6b4c7Sopenharmony_ci 10255c6b4c7Sopenharmony_ci### DumpFaultLog 10355c6b4c7Sopenharmony_ci 10455c6b4c7Sopenharmony_ci``` 10555c6b4c7Sopenharmony_ciint DumpFaultLog(void); 10655c6b4c7Sopenharmony_ci``` 10755c6b4c7Sopenharmony_ci 10855c6b4c7Sopenharmony_ciRewrite the function for printing exception logs. This function prints the last saved log information. 10955c6b4c7Sopenharmony_ci 11055c6b4c7Sopenharmony_ci### DumpMemRegion 11155c6b4c7Sopenharmony_ci 11255c6b4c7Sopenharmony_ci``` 11355c6b4c7Sopenharmony_ciint DumpMemRegion(unsigned long long addr, unsigned long long size) 11455c6b4c7Sopenharmony_ci``` 11555c6b4c7Sopenharmony_ci 11655c6b4c7Sopenharmony_ciOverwrites 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. 11755c6b4c7Sopenharmony_ci 11855c6b4c7Sopenharmony_ci- Parameter: 11955c6b4c7Sopenharmony_ci |Parameter name|Type|Mandatory|Description 12055c6b4c7Sopenharmony_ci | -------- | -------- | -------- | -------- | 12155c6b4c7Sopenharmony_ci | addr | unsigned long long | Y | Start address of the memory to be queried | 12255c6b4c7Sopenharmony_ci | size | unsigned long long | Y | Internal size to be queried | 12355c6b4c7Sopenharmony_ci 12455c6b4c7Sopenharmony_ci### DumpAllMem 12555c6b4c7Sopenharmony_ci 12655c6b4c7Sopenharmony_ci``` 12755c6b4c7Sopenharmony_ciint DumpAllMem(void); 12855c6b4c7Sopenharmony_ci``` 12955c6b4c7Sopenharmony_ci 13055c6b4c7Sopenharmony_ciOverwrites the function of printing all memory data. This function can print all memory data. 13155c6b4c7Sopenharmony_ci 13255c6b4c7Sopenharmony_ci### PlatformHiDumperIinit 13355c6b4c7Sopenharmony_ci 13455c6b4c7Sopenharmony_ci``` 13555c6b4c7Sopenharmony_ciint PlatformHiDumperIinit(void); 13655c6b4c7Sopenharmony_ci``` 13755c6b4c7Sopenharmony_ci 13855c6b4c7Sopenharmony_ciRewrites the platform hidumper initialization function. This function initializes features such as the at command of HiDumper based on different platforms. 13955c6b4c7Sopenharmony_ci 14055c6b4c7Sopenharmony_ci## Related warehouses 14155c6b4c7Sopenharmony_ci 14255c6b4c7Sopenharmony_ci[Subsystem of DFX](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/DFX%E5%AD%90%E7%B3%BB%E7%BB%9F.md) 14355c6b4c7Sopenharmony_ci 14455c6b4c7Sopenharmony_ci**hiviewdfx\_hidumper\_lite** 14555c6b4c7Sopenharmony_ci 14655c6b4c7Sopenharmony_ci[hiviewdfx\_blackbox](https://gitee.com/openharmony/hiviewdfx_blackbox/blob/master/README_zh.md) 14755c6b4c7Sopenharmony_ci 14855c6b4c7Sopenharmony_ci[hiviewdfx\_hilog\_lite](https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/README_zh.md) 14955c6b4c7Sopenharmony_ci 15055c6b4c7Sopenharmony_ci[hiviewdfx\_hievent\_lite](https://gitee.com/openharmony/hiviewdfx_hievent_lite/blob/master/README_zh.md) 15155c6b4c7Sopenharmony_ci 15255c6b4c7Sopenharmony_ci[hiviewdfx\_hiview\_lite](https://gitee.com/openharmony/hiviewdfx_hiview_lite/blob/master/README_zh.md) 153