1e41f4b71Sopenharmony_ci# HiDebug
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Overview
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciProvides APIs for debugging.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ciYou can use the APIs to obtain CPU usage, memory information, heap information, and capture traces. 
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci**Since**: 12
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci## Summary
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci### Files
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci| Name | Description |
19e41f4b71Sopenharmony_ci| -------- | -------- |
20e41f4b71Sopenharmony_ci| [hidebug.h](hidebug_8h.md) | Defines the APIs for debugging. |
21e41f4b71Sopenharmony_ci| [hidebug_type.h](hidebug__type_8h.md) | Defines the structs of the HiDebug module. |
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci### Structs
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci| Name | Description |
27e41f4b71Sopenharmony_ci| -------- | -------- |
28e41f4b71Sopenharmony_ci| struct  [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) | Defines the CPU usage of all threads of an application. |
29e41f4b71Sopenharmony_ci| struct  [HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) | Defines the system memory information. |
30e41f4b71Sopenharmony_ci| struct  [HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) | Defines the local memory information of an application process. |
31e41f4b71Sopenharmony_ci| struct  [HiDebug_MemoryLimit](_hi_debug___memory_limit.md) | Defines the memory limit of an application process. |
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci### Macros
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci| Name | Description |
37e41f4b71Sopenharmony_ci| -------- | -------- |
38e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_FFRT](#hidebug_trace_tag_ffrt)   (1ULL << 13) | Indicates the FFRT task. |
39e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_COMMON_LIBRARY](#hidebug_trace_tag_common_library)   (1ULL << 16) | Indicates the common library subsystem. |
40e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_HDF](#hidebug_trace_tag_hdf)   (1ULL << 18) | Indicates the HDF subsystem. |
41e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NET](#hidebug_trace_tag_net)   (1ULL << 23) | Indicates the network. |
42e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NWEB](#hidebug_trace_tag_nweb)   (1ULL << 24) | Indicates the NWeb. |
43e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_AUDIO](#hidebug_trace_tag_distributed_audio)   (1ULL << 27) | Indicates the distributed audio. |
44e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_FILE_MANAGEMENT](#hidebug_trace_tag_file_management)   (1ULL << 29) | Indicates the file management. |
45e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_OHOS](#hidebug_trace_tag_ohos)   (1ULL << 30) | Indicates the OpenHarmony OS. |
46e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ABILITY_MANAGER](#hidebug_trace_tag_ability_manager)   (1ULL << 31) | Indicates the ability manager. |
47e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_CAMERA](#hidebug_trace_tag_camera)   (1ULL << 32) | Indicates the camera module. |
48e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MEDIA](#hidebug_trace_tag_media)   (1ULL << 33) | Indicates the media module. |
49e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_IMAGE](#hidebug_trace_tag_image)   (1ULL << 34) | Indicates the image module. |
50e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_AUDIO](#hidebug_trace_tag_audio)   (1ULL << 35) | Indicates the audio module. |
51e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_DATA](#hidebug_trace_tag_distributed_data)   (1ULL << 36) | Indicates the distributed data management. |
52e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_GRAPHICS](#hidebug_trace_tag_graphics)   (1ULL << 38) | Indicates the graphics module. |
53e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ARKUI](#hidebug_trace_tag_arkui)   (1ULL << 39) | Indicates the ArkUI development framework. |
54e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NOTIFICATION](#hidebug_trace_tag_notification)   (1ULL << 40) | Indicates the notification module. |
55e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MISC](#hidebug_trace_tag_misc)   (1ULL << 41) | Indicates the MISC module. |
56e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MULTIMODAL_INPUT](#hidebug_trace_tag_multimodal_input)   (1ULL << 42) | Indicates the multimodal input module. |
57e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_RPC](#hidebug_trace_tag_rpc)   (1ULL << 46) | Indicates the RPC. |
58e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ARK](#hidebug_trace_tag_ark)   (1ULL << 47) | Indicates the JSVM. |
59e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_WINDOW_MANAGER](#hidebug_trace_tag_window_manager)   (1ULL << 48) | Indicates the window manager. |
60e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_SCREEN](#hidebug_trace_tag_distributed_screen)   (1ULL << 50) | Indicates the distributed screen. |
61e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_CAMERA](#hidebug_trace_tag_distributed_camera)   (1ULL << 51) | Indicates the distributed camera. |
62e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_FRAMEWORK](#hidebug_trace_tag_distributed_hardware_framework)   (1ULL << 52) | Indicates the distributed hardware framework. |
63e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_GLOBAL_RESOURCE_MANAGER](#hidebug_trace_tag_global_resource_manager)   (1ULL << 53) | Indicates the global resource manager. |
64e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_DEVICE_MANAGER](#hidebug_trace_tag_distributed_hardware_device_manager)   (1ULL << 54) | Indicates the distributed hardware device manager. |
65e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_SAMGR](#hidebug_trace_tag_samgr)   (1ULL << 55) | Indicates the service ability manager (SAMGR). |
66e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_POWER_MANAGER](#hidebug_trace_tag_power_manager)   (1ULL << 56) | Indicates the power manager. |
67e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_SCHEDULER](#hidebug_trace_tag_distributed_scheduler)   (1ULL << 57) | Indicates the distributed scheduler. |
68e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_INPUT](#hidebug_trace_tag_distributed_input)   (1ULL << 59) | Indicates the distributed input. |
69e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_BLUETOOTH](#hidebug_trace_tag_bluetooth)   (1ULL << 60) | Indicates the Bluetooth. |
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ci### Types
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci| Name | Description |
75e41f4b71Sopenharmony_ci| -------- | -------- |
76e41f4b71Sopenharmony_ci| typedef enum [HiDebug_ErrorCode](#hidebug_errorcode-1) [HiDebug_ErrorCode](#hidebug_errorcode) | Defines an enum for error codes. |
77e41f4b71Sopenharmony_ci| typedef struct [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) [HiDebug_ThreadCpuUsage](#hidebug_threadcpuusage) | Defines a struct for the CPU usage of all threads of an application. |
78e41f4b71Sopenharmony_ci| typedef [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) \* [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) | Defines the pointer to **HiDebug_ThreadCpuUsage**. |
79e41f4b71Sopenharmony_ci| typedef struct [HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) [HiDebug_SystemMemInfo](#hidebug_systemmeminfo) | Defines a struct for the system memory information. |
80e41f4b71Sopenharmony_ci| typedef struct [HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) [HiDebug_NativeMemInfo](#hidebug_nativememinfo) | Defines a struct for the local memory information of the application process. |
81e41f4b71Sopenharmony_ci| typedef struct [HiDebug_MemoryLimit](_hi_debug___memory_limit.md) [HiDebug_MemoryLimit](#hidebug_memorylimit) | Defines a struct for the memory limit of an application process. |
82e41f4b71Sopenharmony_ci| typedef enum [HiDebug_TraceFlag](#hidebug_traceflag-1) [HiDebug_TraceFlag](#hidebug_traceflag) | Defines an enum for the types of threads for trace collection. |
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci
85e41f4b71Sopenharmony_ci### Enums
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci| Name | Description |
88e41f4b71Sopenharmony_ci| -------- | -------- |
89e41f4b71Sopenharmony_ci| [HiDebug_ErrorCode](#hidebug_errorcode-1) {<br>HIDEBUG_SUCCESS = 0,<br>HIDEBUG_INVALID_ARGUMENT = 401,<br>HIDEBUG_TRACE_CAPTURED_ALREADY = 11400102,<br>HIDEBUG_NO_PERMISSION = 11400103,<br>HIDEBUG_TRACE_ABNORMAL = 11400104,<br>HIDEBUG_NO_TRACE_RUNNING = 11400105<br>} | Enumerates the error codes used in the HiDebug module. |
90e41f4b71Sopenharmony_ci| [HiDebug_TraceFlag](#hidebug_traceflag-1) {<br>HIDEBUG_TRACE_FLAG_MAIN_THREAD = 1, HIDEBUG_TRACE_FLAG_ALL_THREADS = 2<br>} | Enumerates the types of the threads for trace collection. |
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ci### Functions
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci| Name | Description |
96e41f4b71Sopenharmony_ci| -------- | -------- |
97e41f4b71Sopenharmony_ci| double [OH_HiDebug_GetSystemCpuUsage](#oh_hidebug_getsystemcpuusage) () | Obtains the CPU usage of the system. |
98e41f4b71Sopenharmony_ci| double [OH_HiDebug_GetAppCpuUsage](#oh_hidebug_getappcpuusage) () | Obtains the CPU usage of an application. |
99e41f4b71Sopenharmony_ci| [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) [OH_HiDebug_GetAppThreadCpuUsage](#oh_hidebug_getappthreadcpuusage) () | Obtains the CPU usage of all threads of an application. |
100e41f4b71Sopenharmony_ci| void [OH_HiDebug_FreeThreadCpuUsage](#oh_hidebug_freethreadcpuusage) ([HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) \*threadCpuUsage) | Releases the **HiDebug_ThreadCpuUsagePtr**. |
101e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetSystemMemInfo](#oh_hidebug_getsystemmeminfo) ([HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) \*systemMemInfo) | Obtains system memory information. |
102e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetAppNativeMemInfo](#oh_hidebug_getappnativememinfo) ([HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) \*nativeMemInfo) | Obtains the memory information of an application process. |
103e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetAppMemoryLimit](#oh_hidebug_getappmemorylimit) ([HiDebug_MemoryLimit](_hi_debug___memory_limit.md) \*memoryLimit) | Obtains the memory limit of an application process. |
104e41f4b71Sopenharmony_ci| [HiDebug_ErrorCode](#hidebug_errorcode) [OH_HiDebug_StartAppTraceCapture](#oh_hidebug_startapptracecapture) ([HiDebug_TraceFlag](#hidebug_traceflag) flag, uint64_t tags, uint32_t limitSize, char \*fileName, uint32_t length) | Starts application trace collection. |
105e41f4b71Sopenharmony_ci| [HiDebug_ErrorCode](#hidebug_errorcode) [OH_HiDebug_StopAppTraceCapture](#oh_hidebug_stopapptracecapture) () | Stops application trace collection. |
106e41f4b71Sopenharmony_ci
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ci## Macro Description
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_ABILITY_MANAGER
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ci```
114e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_ABILITY_MANAGER   (1ULL << 31)
115e41f4b71Sopenharmony_ci```
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci**Description**
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ciIndicates the ability manager.
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci**Since**: 12
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_ARK
125e41f4b71Sopenharmony_ci
126e41f4b71Sopenharmony_ci```
127e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_ARK   (1ULL << 47)
128e41f4b71Sopenharmony_ci```
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_ci**Description**
131e41f4b71Sopenharmony_ci
132e41f4b71Sopenharmony_ciIndicates the JSVM.
133e41f4b71Sopenharmony_ci
134e41f4b71Sopenharmony_ci**Since**: 12
135e41f4b71Sopenharmony_ci
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_ARKUI
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ci```
140e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_ARKUI   (1ULL << 39)
141e41f4b71Sopenharmony_ci```
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci**Description**
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ciIndicates the ArkUI development framework.
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci**Since**: 12
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_AUDIO
151e41f4b71Sopenharmony_ci
152e41f4b71Sopenharmony_ci```
153e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_AUDIO   (1ULL << 35)
154e41f4b71Sopenharmony_ci```
155e41f4b71Sopenharmony_ci
156e41f4b71Sopenharmony_ci**Description**
157e41f4b71Sopenharmony_ci
158e41f4b71Sopenharmony_ciIndicates the audio module.
159e41f4b71Sopenharmony_ci
160e41f4b71Sopenharmony_ci**Since**: 12
161e41f4b71Sopenharmony_ci
162e41f4b71Sopenharmony_ci
163e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_BLUETOOTH
164e41f4b71Sopenharmony_ci
165e41f4b71Sopenharmony_ci```
166e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_BLUETOOTH   (1ULL << 60)
167e41f4b71Sopenharmony_ci```
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci**Description**
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ciIndicates the Bluetooth.
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ci**Since**: 12
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci
176e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_CAMERA
177e41f4b71Sopenharmony_ci
178e41f4b71Sopenharmony_ci```
179e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_CAMERA   (1ULL << 32)
180e41f4b71Sopenharmony_ci```
181e41f4b71Sopenharmony_ci
182e41f4b71Sopenharmony_ci**Description**
183e41f4b71Sopenharmony_ci
184e41f4b71Sopenharmony_ciIndicates the camera module.
185e41f4b71Sopenharmony_ci
186e41f4b71Sopenharmony_ci**Since**: 12
187e41f4b71Sopenharmony_ci
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_COMMON_LIBRARY
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci```
192e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_COMMON_LIBRARY   (1ULL << 16)
193e41f4b71Sopenharmony_ci```
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci**Description**
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ciIndicates the common library subsystem.
198e41f4b71Sopenharmony_ci
199e41f4b71Sopenharmony_ci**Since**: 12
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci
202e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_AUDIO
203e41f4b71Sopenharmony_ci
204e41f4b71Sopenharmony_ci```
205e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_AUDIO   (1ULL << 27)
206e41f4b71Sopenharmony_ci```
207e41f4b71Sopenharmony_ci
208e41f4b71Sopenharmony_ci**Description**
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_ciIndicates the distributed audio.
211e41f4b71Sopenharmony_ci
212e41f4b71Sopenharmony_ci**Since**: 12
213e41f4b71Sopenharmony_ci
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_CAMERA
216e41f4b71Sopenharmony_ci
217e41f4b71Sopenharmony_ci```
218e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_CAMERA   (1ULL << 51)
219e41f4b71Sopenharmony_ci```
220e41f4b71Sopenharmony_ci
221e41f4b71Sopenharmony_ci**Description**
222e41f4b71Sopenharmony_ci
223e41f4b71Sopenharmony_ciIndicates the distributed camera.
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_ci**Since**: 12
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ci
228e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_DATA
229e41f4b71Sopenharmony_ci
230e41f4b71Sopenharmony_ci```
231e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_DATA   (1ULL << 36)
232e41f4b71Sopenharmony_ci```
233e41f4b71Sopenharmony_ci
234e41f4b71Sopenharmony_ci**Description**
235e41f4b71Sopenharmony_ci
236e41f4b71Sopenharmony_ciIndicates the distributed data management.
237e41f4b71Sopenharmony_ci
238e41f4b71Sopenharmony_ci**Since**: 12
239e41f4b71Sopenharmony_ci
240e41f4b71Sopenharmony_ci
241e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_DEVICE_MANAGER
242e41f4b71Sopenharmony_ci
243e41f4b71Sopenharmony_ci```
244e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_DEVICE_MANAGER   (1ULL << 54)
245e41f4b71Sopenharmony_ci```
246e41f4b71Sopenharmony_ci
247e41f4b71Sopenharmony_ci**Description**
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_ciIndicates the distributed hardware device manager.
250e41f4b71Sopenharmony_ci
251e41f4b71Sopenharmony_ci**Since**: 12
252e41f4b71Sopenharmony_ci
253e41f4b71Sopenharmony_ci
254e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_FRAMEWORK
255e41f4b71Sopenharmony_ci
256e41f4b71Sopenharmony_ci```
257e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_FRAMEWORK   (1ULL << 52)
258e41f4b71Sopenharmony_ci```
259e41f4b71Sopenharmony_ci
260e41f4b71Sopenharmony_ci**Description**
261e41f4b71Sopenharmony_ci
262e41f4b71Sopenharmony_ciIndicates the distributed hardware framework.
263e41f4b71Sopenharmony_ci
264e41f4b71Sopenharmony_ci**Since**: 12
265e41f4b71Sopenharmony_ci
266e41f4b71Sopenharmony_ci
267e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_INPUT
268e41f4b71Sopenharmony_ci
269e41f4b71Sopenharmony_ci```
270e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_INPUT   (1ULL << 59)
271e41f4b71Sopenharmony_ci```
272e41f4b71Sopenharmony_ci
273e41f4b71Sopenharmony_ci**Description**
274e41f4b71Sopenharmony_ci
275e41f4b71Sopenharmony_ciIndicates the distributed input.
276e41f4b71Sopenharmony_ci
277e41f4b71Sopenharmony_ci**Since**: 12
278e41f4b71Sopenharmony_ci
279e41f4b71Sopenharmony_ci
280e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_SCHEDULER
281e41f4b71Sopenharmony_ci
282e41f4b71Sopenharmony_ci```
283e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_SCHEDULER   (1ULL << 57)
284e41f4b71Sopenharmony_ci```
285e41f4b71Sopenharmony_ci
286e41f4b71Sopenharmony_ci**Description**
287e41f4b71Sopenharmony_ci
288e41f4b71Sopenharmony_ciIndicates the distributed scheduler.
289e41f4b71Sopenharmony_ci
290e41f4b71Sopenharmony_ci**Since**: 12
291e41f4b71Sopenharmony_ci
292e41f4b71Sopenharmony_ci
293e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_DISTRIBUTED_SCREEN
294e41f4b71Sopenharmony_ci
295e41f4b71Sopenharmony_ci```
296e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_DISTRIBUTED_SCREEN   (1ULL << 50)
297e41f4b71Sopenharmony_ci```
298e41f4b71Sopenharmony_ci
299e41f4b71Sopenharmony_ci**Description**
300e41f4b71Sopenharmony_ci
301e41f4b71Sopenharmony_ciIndicates the distributed screen.
302e41f4b71Sopenharmony_ci
303e41f4b71Sopenharmony_ci**Since**: 12
304e41f4b71Sopenharmony_ci
305e41f4b71Sopenharmony_ci
306e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_FFRT
307e41f4b71Sopenharmony_ci
308e41f4b71Sopenharmony_ci```
309e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_FFRT   (1ULL << 13)
310e41f4b71Sopenharmony_ci```
311e41f4b71Sopenharmony_ci
312e41f4b71Sopenharmony_ci**Description**
313e41f4b71Sopenharmony_ci
314e41f4b71Sopenharmony_ciIndicates the FFRT task.
315e41f4b71Sopenharmony_ci
316e41f4b71Sopenharmony_ci**Since**: 12
317e41f4b71Sopenharmony_ci
318e41f4b71Sopenharmony_ci
319e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_FILE_MANAGEMENT
320e41f4b71Sopenharmony_ci
321e41f4b71Sopenharmony_ci```
322e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_FILE_MANAGEMENT   (1ULL << 29)
323e41f4b71Sopenharmony_ci```
324e41f4b71Sopenharmony_ci
325e41f4b71Sopenharmony_ci**Description**
326e41f4b71Sopenharmony_ci
327e41f4b71Sopenharmony_ciIndicates the file management.
328e41f4b71Sopenharmony_ci
329e41f4b71Sopenharmony_ci**Since**: 12
330e41f4b71Sopenharmony_ci
331e41f4b71Sopenharmony_ci
332e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_GLOBAL_RESOURCE_MANAGER
333e41f4b71Sopenharmony_ci
334e41f4b71Sopenharmony_ci```
335e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_GLOBAL_RESOURCE_MANAGER   (1ULL << 53)
336e41f4b71Sopenharmony_ci```
337e41f4b71Sopenharmony_ci
338e41f4b71Sopenharmony_ci**Description**
339e41f4b71Sopenharmony_ci
340e41f4b71Sopenharmony_ciIndicates the global resource manager.
341e41f4b71Sopenharmony_ci
342e41f4b71Sopenharmony_ci**Since**: 12
343e41f4b71Sopenharmony_ci
344e41f4b71Sopenharmony_ci
345e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_GRAPHICS
346e41f4b71Sopenharmony_ci
347e41f4b71Sopenharmony_ci```
348e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_GRAPHICS   (1ULL << 38)
349e41f4b71Sopenharmony_ci```
350e41f4b71Sopenharmony_ci
351e41f4b71Sopenharmony_ci**Description**
352e41f4b71Sopenharmony_ci
353e41f4b71Sopenharmony_ciIndicates the graphics module.
354e41f4b71Sopenharmony_ci
355e41f4b71Sopenharmony_ci**Since**: 12
356e41f4b71Sopenharmony_ci
357e41f4b71Sopenharmony_ci
358e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_HDF
359e41f4b71Sopenharmony_ci
360e41f4b71Sopenharmony_ci```
361e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_HDF   (1ULL << 18)
362e41f4b71Sopenharmony_ci```
363e41f4b71Sopenharmony_ci
364e41f4b71Sopenharmony_ci**Description**
365e41f4b71Sopenharmony_ci
366e41f4b71Sopenharmony_ciIndicates the HDF subsystem.
367e41f4b71Sopenharmony_ci
368e41f4b71Sopenharmony_ci**Since**: 12
369e41f4b71Sopenharmony_ci
370e41f4b71Sopenharmony_ci
371e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_IMAGE
372e41f4b71Sopenharmony_ci
373e41f4b71Sopenharmony_ci```
374e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_IMAGE   (1ULL << 34)
375e41f4b71Sopenharmony_ci```
376e41f4b71Sopenharmony_ci
377e41f4b71Sopenharmony_ci**Description**
378e41f4b71Sopenharmony_ci
379e41f4b71Sopenharmony_ciIndicates the image module.
380e41f4b71Sopenharmony_ci
381e41f4b71Sopenharmony_ci**Since**: 12
382e41f4b71Sopenharmony_ci
383e41f4b71Sopenharmony_ci
384e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_MEDIA
385e41f4b71Sopenharmony_ci
386e41f4b71Sopenharmony_ci```
387e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_MEDIA   (1ULL << 33)
388e41f4b71Sopenharmony_ci```
389e41f4b71Sopenharmony_ci
390e41f4b71Sopenharmony_ci**Description**
391e41f4b71Sopenharmony_ci
392e41f4b71Sopenharmony_ciIndicates the media module.
393e41f4b71Sopenharmony_ci
394e41f4b71Sopenharmony_ci**Since**: 12
395e41f4b71Sopenharmony_ci
396e41f4b71Sopenharmony_ci
397e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_MISC
398e41f4b71Sopenharmony_ci
399e41f4b71Sopenharmony_ci```
400e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_MISC   (1ULL << 41)
401e41f4b71Sopenharmony_ci```
402e41f4b71Sopenharmony_ci
403e41f4b71Sopenharmony_ci**Description**
404e41f4b71Sopenharmony_ci
405e41f4b71Sopenharmony_ciIndicates the MISC module.
406e41f4b71Sopenharmony_ci
407e41f4b71Sopenharmony_ci**Since**: 12
408e41f4b71Sopenharmony_ci
409e41f4b71Sopenharmony_ci
410e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_MULTIMODAL_INPUT
411e41f4b71Sopenharmony_ci
412e41f4b71Sopenharmony_ci```
413e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_MULTIMODAL_INPUT   (1ULL << 42)
414e41f4b71Sopenharmony_ci```
415e41f4b71Sopenharmony_ci
416e41f4b71Sopenharmony_ci**Description**
417e41f4b71Sopenharmony_ci
418e41f4b71Sopenharmony_ciIndicates the multimodal input module.
419e41f4b71Sopenharmony_ci
420e41f4b71Sopenharmony_ci**Since**: 12
421e41f4b71Sopenharmony_ci
422e41f4b71Sopenharmony_ci
423e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_NET
424e41f4b71Sopenharmony_ci
425e41f4b71Sopenharmony_ci```
426e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_NET   (1ULL << 23)
427e41f4b71Sopenharmony_ci```
428e41f4b71Sopenharmony_ci
429e41f4b71Sopenharmony_ci**Description**
430e41f4b71Sopenharmony_ci
431e41f4b71Sopenharmony_ciIndicates the network.
432e41f4b71Sopenharmony_ci
433e41f4b71Sopenharmony_ci**Since**: 12
434e41f4b71Sopenharmony_ci
435e41f4b71Sopenharmony_ci
436e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_NOTIFICATION
437e41f4b71Sopenharmony_ci
438e41f4b71Sopenharmony_ci```
439e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_NOTIFICATION   (1ULL << 40)
440e41f4b71Sopenharmony_ci```
441e41f4b71Sopenharmony_ci
442e41f4b71Sopenharmony_ci**Description**
443e41f4b71Sopenharmony_ci
444e41f4b71Sopenharmony_ciIndicates the notification module.
445e41f4b71Sopenharmony_ci
446e41f4b71Sopenharmony_ci**Since**: 12
447e41f4b71Sopenharmony_ci
448e41f4b71Sopenharmony_ci
449e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_NWEB
450e41f4b71Sopenharmony_ci
451e41f4b71Sopenharmony_ci```
452e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_NWEB   (1ULL << 24)
453e41f4b71Sopenharmony_ci```
454e41f4b71Sopenharmony_ci
455e41f4b71Sopenharmony_ci**Description**
456e41f4b71Sopenharmony_ci
457e41f4b71Sopenharmony_ciIndicates the NWeb.
458e41f4b71Sopenharmony_ci
459e41f4b71Sopenharmony_ci**Since**: 12
460e41f4b71Sopenharmony_ci
461e41f4b71Sopenharmony_ci
462e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_OHOS
463e41f4b71Sopenharmony_ci
464e41f4b71Sopenharmony_ci```
465e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_OHOS   (1ULL << 30)
466e41f4b71Sopenharmony_ci```
467e41f4b71Sopenharmony_ci
468e41f4b71Sopenharmony_ci**Description**
469e41f4b71Sopenharmony_ci
470e41f4b71Sopenharmony_ciIndicates the OpenHarmony OS.
471e41f4b71Sopenharmony_ci
472e41f4b71Sopenharmony_ci**Since**: 12
473e41f4b71Sopenharmony_ci
474e41f4b71Sopenharmony_ci
475e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_POWER_MANAGER
476e41f4b71Sopenharmony_ci
477e41f4b71Sopenharmony_ci```
478e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_POWER_MANAGER   (1ULL << 56)
479e41f4b71Sopenharmony_ci```
480e41f4b71Sopenharmony_ci
481e41f4b71Sopenharmony_ci**Description**
482e41f4b71Sopenharmony_ci
483e41f4b71Sopenharmony_ciIndicates the power manager.
484e41f4b71Sopenharmony_ci
485e41f4b71Sopenharmony_ci**Since**: 12
486e41f4b71Sopenharmony_ci
487e41f4b71Sopenharmony_ci
488e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_RPC
489e41f4b71Sopenharmony_ci
490e41f4b71Sopenharmony_ci```
491e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_RPC   (1ULL << 46)
492e41f4b71Sopenharmony_ci```
493e41f4b71Sopenharmony_ci
494e41f4b71Sopenharmony_ci**Description**
495e41f4b71Sopenharmony_ci
496e41f4b71Sopenharmony_ciIndicates the RPC.
497e41f4b71Sopenharmony_ci
498e41f4b71Sopenharmony_ci**Since**: 12
499e41f4b71Sopenharmony_ci
500e41f4b71Sopenharmony_ci
501e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_SAMGR
502e41f4b71Sopenharmony_ci
503e41f4b71Sopenharmony_ci```
504e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_SAMGR   (1ULL << 55)
505e41f4b71Sopenharmony_ci```
506e41f4b71Sopenharmony_ci
507e41f4b71Sopenharmony_ci**Description**
508e41f4b71Sopenharmony_ci
509e41f4b71Sopenharmony_ciIndicates the service ability manager (SAMGR).
510e41f4b71Sopenharmony_ci
511e41f4b71Sopenharmony_ci**Since**: 12
512e41f4b71Sopenharmony_ci
513e41f4b71Sopenharmony_ci
514e41f4b71Sopenharmony_ci### HIDEBUG_TRACE_TAG_WINDOW_MANAGER
515e41f4b71Sopenharmony_ci
516e41f4b71Sopenharmony_ci```
517e41f4b71Sopenharmony_ci#define HIDEBUG_TRACE_TAG_WINDOW_MANAGER   (1ULL << 48)
518e41f4b71Sopenharmony_ci```
519e41f4b71Sopenharmony_ci
520e41f4b71Sopenharmony_ci**Description**
521e41f4b71Sopenharmony_ci
522e41f4b71Sopenharmony_ciIndicates the window manager.
523e41f4b71Sopenharmony_ci
524e41f4b71Sopenharmony_ci**Since**: 12
525e41f4b71Sopenharmony_ci
526e41f4b71Sopenharmony_ci
527e41f4b71Sopenharmony_ci## Type Description
528e41f4b71Sopenharmony_ci
529e41f4b71Sopenharmony_ci
530e41f4b71Sopenharmony_ci### HiDebug_ErrorCode
531e41f4b71Sopenharmony_ci
532e41f4b71Sopenharmony_ci```
533e41f4b71Sopenharmony_citypedef enum HiDebug_ErrorCode HiDebug_ErrorCode
534e41f4b71Sopenharmony_ci```
535e41f4b71Sopenharmony_ci
536e41f4b71Sopenharmony_ci**Description**
537e41f4b71Sopenharmony_ci
538e41f4b71Sopenharmony_ciDefines an enum for error codes.
539e41f4b71Sopenharmony_ci
540e41f4b71Sopenharmony_ci**Since**: 12
541e41f4b71Sopenharmony_ci
542e41f4b71Sopenharmony_ci
543e41f4b71Sopenharmony_ci### HiDebug_MemoryLimit
544e41f4b71Sopenharmony_ci
545e41f4b71Sopenharmony_ci```
546e41f4b71Sopenharmony_citypedef struct HiDebug_MemoryLimit HiDebug_MemoryLimit
547e41f4b71Sopenharmony_ci```
548e41f4b71Sopenharmony_ci
549e41f4b71Sopenharmony_ci**Description**
550e41f4b71Sopenharmony_ci
551e41f4b71Sopenharmony_ciDefines a struct for the memory limit of an application process.
552e41f4b71Sopenharmony_ci
553e41f4b71Sopenharmony_ci**Since**: 12
554e41f4b71Sopenharmony_ci
555e41f4b71Sopenharmony_ci
556e41f4b71Sopenharmony_ci### HiDebug_NativeMemInfo
557e41f4b71Sopenharmony_ci
558e41f4b71Sopenharmony_ci```
559e41f4b71Sopenharmony_citypedef struct HiDebug_NativeMemInfo HiDebug_NativeMemInfo
560e41f4b71Sopenharmony_ci```
561e41f4b71Sopenharmony_ci
562e41f4b71Sopenharmony_ci**Description**
563e41f4b71Sopenharmony_ci
564e41f4b71Sopenharmony_ciDefines a struct for the local memory information of the application process.
565e41f4b71Sopenharmony_ci
566e41f4b71Sopenharmony_ci**Since**: 12
567e41f4b71Sopenharmony_ci
568e41f4b71Sopenharmony_ci
569e41f4b71Sopenharmony_ci### HiDebug_SystemMemInfo
570e41f4b71Sopenharmony_ci
571e41f4b71Sopenharmony_ci```
572e41f4b71Sopenharmony_citypedef struct HiDebug_SystemMemInfo HiDebug_SystemMemInfo
573e41f4b71Sopenharmony_ci```
574e41f4b71Sopenharmony_ci
575e41f4b71Sopenharmony_ci**Description**
576e41f4b71Sopenharmony_ci
577e41f4b71Sopenharmony_ciDefines a struct for the system memory information.
578e41f4b71Sopenharmony_ci
579e41f4b71Sopenharmony_ci**Since**: 12
580e41f4b71Sopenharmony_ci
581e41f4b71Sopenharmony_ci
582e41f4b71Sopenharmony_ci### HiDebug_ThreadCpuUsage
583e41f4b71Sopenharmony_ci
584e41f4b71Sopenharmony_ci```
585e41f4b71Sopenharmony_citypedef struct HiDebug_ThreadCpuUsage HiDebug_ThreadCpuUsage
586e41f4b71Sopenharmony_ci```
587e41f4b71Sopenharmony_ci
588e41f4b71Sopenharmony_ci**Description**
589e41f4b71Sopenharmony_ci
590e41f4b71Sopenharmony_ciDefines a struct for the CPU usage of all threads of an application.
591e41f4b71Sopenharmony_ci
592e41f4b71Sopenharmony_ci**Since**: 12
593e41f4b71Sopenharmony_ci
594e41f4b71Sopenharmony_ci
595e41f4b71Sopenharmony_ci### HiDebug_ThreadCpuUsagePtr
596e41f4b71Sopenharmony_ci
597e41f4b71Sopenharmony_ci```
598e41f4b71Sopenharmony_citypedef HiDebug_ThreadCpuUsage* HiDebug_ThreadCpuUsagePtr
599e41f4b71Sopenharmony_ci```
600e41f4b71Sopenharmony_ci
601e41f4b71Sopenharmony_ci**Description**
602e41f4b71Sopenharmony_ci
603e41f4b71Sopenharmony_ciDefines the pointer to **HiDebug_ThreadCpuUsage**.
604e41f4b71Sopenharmony_ci
605e41f4b71Sopenharmony_ci**Since**: 12
606e41f4b71Sopenharmony_ci
607e41f4b71Sopenharmony_ci
608e41f4b71Sopenharmony_ci### HiDebug_TraceFlag
609e41f4b71Sopenharmony_ci
610e41f4b71Sopenharmony_ci```
611e41f4b71Sopenharmony_citypedef enum HiDebug_TraceFlag HiDebug_TraceFlag
612e41f4b71Sopenharmony_ci```
613e41f4b71Sopenharmony_ci
614e41f4b71Sopenharmony_ci**Description**
615e41f4b71Sopenharmony_ci
616e41f4b71Sopenharmony_ciDefines an enum for the types of threads for trace collection.
617e41f4b71Sopenharmony_ci
618e41f4b71Sopenharmony_ci**Since**: 12
619e41f4b71Sopenharmony_ci
620e41f4b71Sopenharmony_ci
621e41f4b71Sopenharmony_ci## Enum Description
622e41f4b71Sopenharmony_ci
623e41f4b71Sopenharmony_ci
624e41f4b71Sopenharmony_ci### HiDebug_ErrorCode
625e41f4b71Sopenharmony_ci
626e41f4b71Sopenharmony_ci```
627e41f4b71Sopenharmony_cienum HiDebug_ErrorCode
628e41f4b71Sopenharmony_ci```
629e41f4b71Sopenharmony_ci
630e41f4b71Sopenharmony_ci**Description**
631e41f4b71Sopenharmony_ci
632e41f4b71Sopenharmony_ciEnumerates the error codes used in the HiDebug module.
633e41f4b71Sopenharmony_ci
634e41f4b71Sopenharmony_ci**Since**: 12
635e41f4b71Sopenharmony_ci
636e41f4b71Sopenharmony_ci| Value | Description |
637e41f4b71Sopenharmony_ci| -------- | -------- |
638e41f4b71Sopenharmony_ci| HIDEBUG_SUCCESS | Execution successful. |
639e41f4b71Sopenharmony_ci| HIDEBUG_INVALID_ARGUMENT | Invalid parameter type or incorrect parameter value. |
640e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_CAPTURED_ALREADY | Repeated collection. |
641e41f4b71Sopenharmony_ci| HIDEBUG_NO_PERMISSION | No file write permission. |
642e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_ABNORMAL | Abnormal trace status. |
643e41f4b71Sopenharmony_ci
644e41f4b71Sopenharmony_ci
645e41f4b71Sopenharmony_ci### HiDebug_TraceFlag
646e41f4b71Sopenharmony_ci
647e41f4b71Sopenharmony_ci```
648e41f4b71Sopenharmony_cienum HiDebug_TraceFlag
649e41f4b71Sopenharmony_ci```
650e41f4b71Sopenharmony_ci
651e41f4b71Sopenharmony_ci**Description**
652e41f4b71Sopenharmony_ci
653e41f4b71Sopenharmony_ciEnumerates the types of the threads for trace collection.
654e41f4b71Sopenharmony_ci
655e41f4b71Sopenharmony_ci**Since**: 12
656e41f4b71Sopenharmony_ci
657e41f4b71Sopenharmony_ci| Value | Description |
658e41f4b71Sopenharmony_ci| -------- | -------- |
659e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_FLAG_MAIN_THREAD | Only the main thread of the current application. |
660e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_FLAG_ALL_THREADS | All threads of the current application. |
661e41f4b71Sopenharmony_ci
662e41f4b71Sopenharmony_ci
663e41f4b71Sopenharmony_ci## Function Description
664e41f4b71Sopenharmony_ci
665e41f4b71Sopenharmony_ci
666e41f4b71Sopenharmony_ci### OH_HiDebug_FreeThreadCpuUsage()
667e41f4b71Sopenharmony_ci
668e41f4b71Sopenharmony_ci```
669e41f4b71Sopenharmony_civoid OH_HiDebug_FreeThreadCpuUsage (HiDebug_ThreadCpuUsagePtr * threadCpuUsage)
670e41f4b71Sopenharmony_ci```
671e41f4b71Sopenharmony_ci
672e41f4b71Sopenharmony_ci**Description**
673e41f4b71Sopenharmony_ci
674e41f4b71Sopenharmony_ciReleases the **HiDebug_ThreadCpuUsagePtr**.
675e41f4b71Sopenharmony_ci
676e41f4b71Sopenharmony_ci**Since**: 12
677e41f4b71Sopenharmony_ci
678e41f4b71Sopenharmony_ci**Parameters**
679e41f4b71Sopenharmony_ci
680e41f4b71Sopenharmony_ci| Name | Description |
681e41f4b71Sopenharmony_ci| -------- | -------- |
682e41f4b71Sopenharmony_ci| threadCpuUsage | Pointer to the buffer that stores the available CPU for all threads of the application. For details, see [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr). The input parameter is obtained by **OH_HiDebug_GetAppThreadCpuUsage()**. |
683e41f4b71Sopenharmony_ci
684e41f4b71Sopenharmony_ci
685e41f4b71Sopenharmony_ci### OH_HiDebug_GetAppCpuUsage()
686e41f4b71Sopenharmony_ci
687e41f4b71Sopenharmony_ci```
688e41f4b71Sopenharmony_cidouble OH_HiDebug_GetAppCpuUsage ()
689e41f4b71Sopenharmony_ci```
690e41f4b71Sopenharmony_ci
691e41f4b71Sopenharmony_ci**Description**
692e41f4b71Sopenharmony_ci
693e41f4b71Sopenharmony_ciObtains the CPU usage of an application.
694e41f4b71Sopenharmony_ci
695e41f4b71Sopenharmony_ci**Since**: 12
696e41f4b71Sopenharmony_ci
697e41f4b71Sopenharmony_ci**Returns**
698e41f4b71Sopenharmony_ci
699e41f4b71Sopenharmony_ciReturns the application CPU usage obtained if the operation is successful. Returns **0** if the operation fails.
700e41f4b71Sopenharmony_ci
701e41f4b71Sopenharmony_ci
702e41f4b71Sopenharmony_ci### OH_HiDebug_GetAppMemoryLimit()
703e41f4b71Sopenharmony_ci
704e41f4b71Sopenharmony_ci```
705e41f4b71Sopenharmony_civoid OH_HiDebug_GetAppMemoryLimit (HiDebug_MemoryLimit * memoryLimit)
706e41f4b71Sopenharmony_ci```
707e41f4b71Sopenharmony_ci
708e41f4b71Sopenharmony_ci**Description**
709e41f4b71Sopenharmony_ci
710e41f4b71Sopenharmony_ciObtains the memory limit of an application process.
711e41f4b71Sopenharmony_ci
712e41f4b71Sopenharmony_ci**Since**: 12
713e41f4b71Sopenharmony_ci
714e41f4b71Sopenharmony_ci**Parameters**
715e41f4b71Sopenharmony_ci
716e41f4b71Sopenharmony_ci| Name | Description |
717e41f4b71Sopenharmony_ci| -------- | -------- |
718e41f4b71Sopenharmony_ci| memoryLimit | Pointer to the [HiDebug_MemoryLimit](_hi_debug___memory_limit.md) to obtain. If the struct is empty, the function call fails. |
719e41f4b71Sopenharmony_ci
720e41f4b71Sopenharmony_ci
721e41f4b71Sopenharmony_ci### OH_HiDebug_GetAppNativeMemInfo()
722e41f4b71Sopenharmony_ci
723e41f4b71Sopenharmony_ci```
724e41f4b71Sopenharmony_civoid OH_HiDebug_GetAppNativeMemInfo (HiDebug_NativeMemInfo * nativeMemInfo)
725e41f4b71Sopenharmony_ci```
726e41f4b71Sopenharmony_ci
727e41f4b71Sopenharmony_ci**Description**
728e41f4b71Sopenharmony_ci
729e41f4b71Sopenharmony_ciObtains the memory information of an application process.
730e41f4b71Sopenharmony_ci
731e41f4b71Sopenharmony_ci**Since**: 12
732e41f4b71Sopenharmony_ci
733e41f4b71Sopenharmony_ci**Parameters**
734e41f4b71Sopenharmony_ci
735e41f4b71Sopenharmony_ci| Name | Description |
736e41f4b71Sopenharmony_ci| -------- | -------- |
737e41f4b71Sopenharmony_ci| nativeMemInfo | Pointer to the [HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) to obtain. If the struct is empty, the function call fails. |
738e41f4b71Sopenharmony_ci
739e41f4b71Sopenharmony_ci
740e41f4b71Sopenharmony_ci### OH_HiDebug_GetAppThreadCpuUsage()
741e41f4b71Sopenharmony_ci
742e41f4b71Sopenharmony_ci```
743e41f4b71Sopenharmony_ciHiDebug_ThreadCpuUsagePtr OH_HiDebug_GetAppThreadCpuUsage ()
744e41f4b71Sopenharmony_ci```
745e41f4b71Sopenharmony_ci
746e41f4b71Sopenharmony_ci**Description**
747e41f4b71Sopenharmony_ci
748e41f4b71Sopenharmony_ciObtains the CPU usage of all threads of an application.
749e41f4b71Sopenharmony_ci
750e41f4b71Sopenharmony_ci**Since**: 12
751e41f4b71Sopenharmony_ci
752e41f4b71Sopenharmony_ci**Returns**
753e41f4b71Sopenharmony_ci
754e41f4b71Sopenharmony_ciReturns the CPU usage of all threads. For details, see [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr). Returns **null** if the function fails to be called.
755e41f4b71Sopenharmony_ci
756e41f4b71Sopenharmony_ci
757e41f4b71Sopenharmony_ci### OH_HiDebug_GetSystemCpuUsage()
758e41f4b71Sopenharmony_ci
759e41f4b71Sopenharmony_ci```
760e41f4b71Sopenharmony_cidouble OH_HiDebug_GetSystemCpuUsage ()
761e41f4b71Sopenharmony_ci```
762e41f4b71Sopenharmony_ci
763e41f4b71Sopenharmony_ci**Description**
764e41f4b71Sopenharmony_ci
765e41f4b71Sopenharmony_ciObtains the CPU usage of the system.
766e41f4b71Sopenharmony_ci
767e41f4b71Sopenharmony_ci**Since**: 12
768e41f4b71Sopenharmony_ci
769e41f4b71Sopenharmony_ci**Returns**
770e41f4b71Sopenharmony_ci
771e41f4b71Sopenharmony_ciReturns the system CPU usage if the operation is successful. Returns **0** if the operation fails.
772e41f4b71Sopenharmony_ci
773e41f4b71Sopenharmony_ci### OH_HiDebug_GetSystemMemInfo()
774e41f4b71Sopenharmony_ci
775e41f4b71Sopenharmony_ci```
776e41f4b71Sopenharmony_civoid OH_HiDebug_GetSystemMemInfo (HiDebug_SystemMemInfo * systemMemInfo)
777e41f4b71Sopenharmony_ci```
778e41f4b71Sopenharmony_ci
779e41f4b71Sopenharmony_ci**Description**
780e41f4b71Sopenharmony_ci
781e41f4b71Sopenharmony_ciObtains system memory information.
782e41f4b71Sopenharmony_ci
783e41f4b71Sopenharmony_ci**Since**: 12
784e41f4b71Sopenharmony_ci
785e41f4b71Sopenharmony_ci**Parameters**
786e41f4b71Sopenharmony_ci
787e41f4b71Sopenharmony_ci| Name | Description |
788e41f4b71Sopenharmony_ci| -------- | -------- |
789e41f4b71Sopenharmony_ci| systemMemInfo | Pointer to the [HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) to obtain. If the struct is empty, the function call fails.|
790e41f4b71Sopenharmony_ci
791e41f4b71Sopenharmony_ci
792e41f4b71Sopenharmony_ci### OH_HiDebug_StartAppTraceCapture()
793e41f4b71Sopenharmony_ci
794e41f4b71Sopenharmony_ci```
795e41f4b71Sopenharmony_ciHiDebug_ErrorCode OH_HiDebug_StartAppTraceCapture (HiDebug_TraceFlag flag, uint64_t tags, uint32_t limitSize, char * fileName, uint32_t length )
796e41f4b71Sopenharmony_ci```
797e41f4b71Sopenharmony_ci
798e41f4b71Sopenharmony_ci**Description**
799e41f4b71Sopenharmony_ci
800e41f4b71Sopenharmony_ciStarts application trace collection.
801e41f4b71Sopenharmony_ci
802e41f4b71Sopenharmony_ci**Since**: 12
803e41f4b71Sopenharmony_ci
804e41f4b71Sopenharmony_ci**Parameters**
805e41f4b71Sopenharmony_ci
806e41f4b71Sopenharmony_ci| Name | Description |
807e41f4b71Sopenharmony_ci| -------- | -------- |
808e41f4b71Sopenharmony_ci| flag | Type of the thread (the main thread or all threads of the application) to trace. |
809e41f4b71Sopenharmony_ci| tags | Modules or subsystems to trace. |
810e41f4b71Sopenharmony_ci| limitSize | Maximum size of the trace file (in bytes), which is 500 MB. |
811e41f4b71Sopenharmony_ci| fileName | Buffer for the output trace file. |
812e41f4b71Sopenharmony_ci| length | Length of the buffer for the output trace file. |
813e41f4b71Sopenharmony_ci
814e41f4b71Sopenharmony_ci**Returns**
815e41f4b71Sopenharmony_ci
816e41f4b71Sopenharmony_ci0 - The operation is successful. 401 - The **fileName** parameter is a null pointer, the input **length** parameter is too small, or the value of **limitSize** is **0** or smaller than **0**. 11400102 - A trace is already started. 11400103 - You do not have the permission to start the trace function. 11400104 - An internal system error occurs.
817e41f4b71Sopenharmony_ci
818e41f4b71Sopenharmony_ci
819e41f4b71Sopenharmony_ci### OH_HiDebug_StopAppTraceCapture()
820e41f4b71Sopenharmony_ci
821e41f4b71Sopenharmony_ci```
822e41f4b71Sopenharmony_ciHiDebug_ErrorCode OH_HiDebug_StopAppTraceCapture ()
823e41f4b71Sopenharmony_ci```
824e41f4b71Sopenharmony_ci
825e41f4b71Sopenharmony_ci**Description**
826e41f4b71Sopenharmony_ci
827e41f4b71Sopenharmony_ciStops application trace collection.
828e41f4b71Sopenharmony_ci
829e41f4b71Sopenharmony_ci**Since**: 12
830e41f4b71Sopenharmony_ci
831e41f4b71Sopenharmony_ci**Returns**
832e41f4b71Sopenharmony_ci
833e41f4b71Sopenharmony_ci0 - The operation is successful. 11400104 - An internal system error occurs. 11400105 - No trace is being performed.
834