• Home
Name Date Size #Lines LOC

..--

lite/07-Sep-2024-238198

mini/07-Sep-2024-500352

BUILD.gnD07-Sep-2024849 2421

LICENSED07-Sep-202410.1 KiB178150

README.mdD07-Sep-20244.8 KiB153101

README.zh.mdD07-Sep-20244.1 KiB152100

bundle.jsonD07-Sep-20241.1 KiB3837

README.md

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

README.zh.md

1# hiviewdfx_hidumper_lite
2
3-   [简介](#简介)
4-   [目录](#目录)
5-   [hidumper_lite的使用](#hidumper_lite的使用)
6-   [系统调用接口定义](#系统调用接口定义)
7-   [重写接口](#重写接口)
8-   [相关仓](#相关仓)
9
10## 简介
11
12hidumper_lite提供liteOS_M系统下dump接口,帮助开发者提供故障日志、内存、CPU等信息的导出功能。
13
14## 目录
15
16Hiview源代码目录结构如下:
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## hidumper_lite的使用
30
31hidumper_lite在liteOS_M下面是通过AT命令进行数据查询的
32
33- 参数:
34  | 命令格式 | 命令含义 |
35  | -------- | -------- |
36  | AT+HIDUMPER= | 打印出CPU、内存和全部的task使用信息 |
37  | AT+HIDUMPER=-dc | 打印出CPU使用信息 |
38  | AT+HIDUMPER=-dm | 打印出内存使用信息 |
39  | AT+HIDUMPER=-df | 打印出最后的故障日志信息 |
40  | AT+HIDUMPER=-dt | 打印出全部task信息 |
41  | AT+HIDUMPER=-h | 打印出帮助信息 |
42  | AT+HIDUMPER=-ikc | 向内核注入故障 |
43  | AT+HIDUMPER=-m | 以16进制形式打印出全部内存数据 |
44  | AT+HIDUMPER=-m,memstart,memsize | 以16进制形式打印出特定内存区域数据。两个参数,memstart:内存起始地址,memsize:内存大小 |
45
46## 系统调用接口定义
47
48### at_hidumper
49
50```
51int at_hidumper(unsigned int argc, const char **argv)
52```
53
54注入到系统的AT指令处理函数
55
56- 参数:
57  | 成员 | 类型 | 必填 | 说明 |
58  | -------- | -------- | -------- | -------- |
59  | argc | unsigned int | 是 | 输入参数的个数。 |
60  | argv | const char** | 是 | 输入参数的内容 |
61
62
63## 重写接口
64
65实例可以参考hi3861芯片的重写,对应位置为device/soc/hisilicon/hi3861v100/sdk_liteos/components/at/src/hidumper_adapter_impl.c
66
67以下的函数都是需要在不同的芯片下重写的:
68
69### DumpSysInfo
70
71```
72int DumpSysInfo(void);
73```
74
75重写打印系统信息函数。该函数打印当前设备系统信息。
76
77### DumpCpuUsage
78
79```
80int DumpCpuUsage(void);
81```
82
83重写打印CPU使用信息函数。该函数打印当前设备CPU使用信息。
84
85### DumpMemUsage
86
87```
88int DumpMemUsage(void);
89```
90
91重写打印内存使用信息函数。该函数打印当前设备内存使用信息。
92
93### DumpTaskInfo
94
95```
96int DumpTaskInfo(void);
97```
98
99重写打印系统全部Task信息函数。该函数打印系统中全部的task信息。
100
101### DumpFaultLog
102
103```
104int DumpFaultLog(void);
105```
106
107重写打印异常日志信息函数。该函数打印最后保存的日志信息。
108
109### DumpMemRegion
110
111```
112int DumpMemRegion(unsigned long long addr, unsigned long long size)
113```
114
115重写打印指定区域内存数据函数。该函数打印从addr开始一共size这大小的内存区域的数据。
116
117- 参数:
118  | 参数名 | 类型 | 必填 | 说明 |
119  | -------- | -------- | -------- | -------- |
120  | addr | unsigned long long | 是 | 需要查询的内存起始地址 |
121  | size | unsigned long long | 是 | 需要查询的内大小 |
122
123### DumpAllMem
124
125```
126int DumpAllMem(void);
127```
128
129重写打印全部内存数据函数。该函数能打印全部内存数据。
130
131### PlatformHiDumperIinit
132
133```
134int PlatformHiDumperIinit(void);
135```
136
137重写平台hidumper初始化函数。该函数根据不同平台初始化HiDumper的at命令等特性。
138
139## 相关仓
140
141[DFX子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/DFX%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
142
143**hiviewdfx\_hidumper\_lite**
144
145[hiviewdfx\_blackbox](https://gitee.com/openharmony/hiviewdfx_blackbox/blob/master/README_zh.md)
146
147[hiviewdfx\_hilog\_lite](https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/README_zh.md)
148
149[hiviewdfx\_hievent\_lite](https://gitee.com/openharmony/hiviewdfx_hievent_lite/blob/master/README_zh.md)
150
151[hiviewdfx\_hiview\_lite](https://gitee.com/openharmony/hiviewdfx_hiview_lite/blob/master/README_zh.md)
152