1e41f4b71Sopenharmony_ci# HiDebug 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## 概述 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ci提供调试功能。 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci本模块函数可用于获取 cpu uage、memory、heap、capture trace等。 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**起始版本:** 12 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## 汇总 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci### 文件 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| 名称 | 描述 | 19e41f4b71Sopenharmony_ci| -------- | -------- | 20e41f4b71Sopenharmony_ci| [hidebug.h](hidebug_8h.md) | 定义HiDebug模块的调试功能。 | 21e41f4b71Sopenharmony_ci| [hidebug_type.h](hidebug__type_8h.md) | HiDebug模块代码结构体定义。 | 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci### 结构体 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci| 名称 | 描述 | 27e41f4b71Sopenharmony_ci| -------- | -------- | 28e41f4b71Sopenharmony_ci| struct [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) | 应用程序所有线程的CPU使用率结构体定义。 | 29e41f4b71Sopenharmony_ci| struct [HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) | 系统内存信息结构类型定义。 | 30e41f4b71Sopenharmony_ci| struct [HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) | 应用程序进程本机内存信息结构类型定义。 | 31e41f4b71Sopenharmony_ci| struct [HiDebug_MemoryLimit](_hi_debug___memory_limit.md) | 应用程序进程内存限制结构类型定义。 | 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci### 宏定义 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci| 名称 | 描述 | 37e41f4b71Sopenharmony_ci| -------- | -------- | 38e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_FFRT](#hidebug_trace_tag_ffrt) (1ULL << 13) | FFRT任务标签。 | 39e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_COMMON_LIBRARY](#hidebug_trace_tag_common_library) (1ULL << 16) | 公共库子系统标签。 | 40e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_HDF](#hidebug_trace_tag_hdf) (1ULL << 18) | HDF子系统标签。 | 41e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NET](#hidebug_trace_tag_net) (1ULL << 23) | 网络标签。 | 42e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NWEB](#hidebug_trace_tag_nweb) (1ULL << 24) | NWeb标签。 | 43e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_AUDIO](#hidebug_trace_tag_distributed_audio) (1ULL << 27) | 分布式音频标签。 | 44e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_FILE_MANAGEMENT](#hidebug_trace_tag_file_management) (1ULL << 29) | 文件管理标签。 | 45e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_OHOS](#hidebug_trace_tag_ohos) (1ULL << 30) | OHOS通用标签。 | 46e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ABILITY_MANAGER](#hidebug_trace_tag_ability_manager) (1ULL << 31) | Ability Manager标签。 | 47e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_CAMERA](#hidebug_trace_tag_camera) (1ULL << 32) | 相机模块标签。 | 48e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MEDIA](#hidebug_trace_tag_media) (1ULL << 33) | 媒体模块标签。 | 49e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_IMAGE](#hidebug_trace_tag_image) (1ULL << 34) | 图像模块标签。 | 50e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_AUDIO](#hidebug_trace_tag_audio) (1ULL << 35) | 音频模块标签。 | 51e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_DATA](#hidebug_trace_tag_distributed_data) (1ULL << 36) | 分布式数据管理器模块标签。 | 52e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_GRAPHICS](#hidebug_trace_tag_graphics) (1ULL << 38) | 图形模块标签。 | 53e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ARKUI](#hidebug_trace_tag_arkui) (1ULL << 39) | ArkUI开发框架标签。 | 54e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_NOTIFICATION](#hidebug_trace_tag_notification) (1ULL << 40) | 通知模块标签。 | 55e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MISC](#hidebug_trace_tag_misc) (1ULL << 41) | MISC模块标签。 | 56e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_MULTIMODAL_INPUT](#hidebug_trace_tag_multimodal_input) (1ULL << 42) | 多模态输入模块标签。 | 57e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_RPC](#hidebug_trace_tag_rpc) (1ULL << 46) | RPC标签。 | 58e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_ARK](#hidebug_trace_tag_ark) (1ULL << 47) | JSVM虚拟机标签。 | 59e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_WINDOW_MANAGER](#hidebug_trace_tag_window_manager) (1ULL << 48) | 窗口管理器标签。 | 60e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_SCREEN](#hidebug_trace_tag_distributed_screen) (1ULL << 50) | 分布式屏幕标签。 | 61e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_CAMERA](#hidebug_trace_tag_distributed_camera) (1ULL << 51) | 分布式相机标签。 | 62e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_FRAMEWORK](#hidebug_trace_tag_distributed_hardware_framework) (1ULL << 52) | 分布式硬件框架标签。 | 63e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_GLOBAL_RESOURCE_MANAGER](#hidebug_trace_tag_global_resource_manager) (1ULL << 53) | 全局资源管理器标签。 | 64e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_HARDWARE_DEVICE_MANAGER](#hidebug_trace_tag_distributed_hardware_device_manager) (1ULL << 54) | 分布式硬件设备管理器标签。 | 65e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_SAMGR](#hidebug_trace_tag_samgr) (1ULL << 55) | SA标签。 | 66e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_POWER_MANAGER](#hidebug_trace_tag_power_manager) (1ULL << 56) | 电源管理器标签。 | 67e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_SCHEDULER](#hidebug_trace_tag_distributed_scheduler) (1ULL << 57) | 分布式调度程序标签。 | 68e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_DISTRIBUTED_INPUT](#hidebug_trace_tag_distributed_input) (1ULL << 59) | 分布式输入标签。 | 69e41f4b71Sopenharmony_ci| [HIDEBUG_TRACE_TAG_BLUETOOTH](#hidebug_trace_tag_bluetooth) (1ULL << 60) | 蓝牙标签。 | 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci### 类型定义 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci| 名称 | 描述 | 75e41f4b71Sopenharmony_ci| -------- | -------- | 76e41f4b71Sopenharmony_ci| typedef enum [HiDebug_ErrorCode](#hidebug_errorcode-1) [HiDebug_ErrorCode](#hidebug_errorcode) | 错误码定义。 | 77e41f4b71Sopenharmony_ci| typedef struct [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) [HiDebug_ThreadCpuUsage](#hidebug_threadcpuusage) | 应用程序所有线程的CPU使用率结构体定义。 | 78e41f4b71Sopenharmony_ci| typedef [HiDebug_ThreadCpuUsage](_hi_debug___thread_cpu_usage.md) \* [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) | HiDebug_ThreadCpuUsage指针定义。 | 79e41f4b71Sopenharmony_ci| typedef struct [HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) [HiDebug_SystemMemInfo](#hidebug_systemmeminfo) | 系统内存信息结构类型定义。 | 80e41f4b71Sopenharmony_ci| typedef struct [HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) [HiDebug_NativeMemInfo](#hidebug_nativememinfo) | 应用程序进程本机内存信息结构类型定义。 | 81e41f4b71Sopenharmony_ci| typedef struct [HiDebug_MemoryLimit](_hi_debug___memory_limit.md) [HiDebug_MemoryLimit](#hidebug_memorylimit) | 应用程序进程内存限制结构类型定义。 | 82e41f4b71Sopenharmony_ci| typedef enum [HiDebug_TraceFlag](#hidebug_traceflag-1) [HiDebug_TraceFlag](#hidebug_traceflag) | 采集trace线程的类型。 | 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci### 枚举 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci| 名称 | 描述 | 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/>} | 错误码定义。 | 90e41f4b71Sopenharmony_ci| [HiDebug_TraceFlag](#hidebug_traceflag-1) {<br/>HIDEBUG_TRACE_FLAG_MAIN_THREAD = 1, HIDEBUG_TRACE_FLAG_ALL_THREADS = 2<br/>} | 采集trace线程的类型。 | 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci### 函数 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci| 名称 | 描述 | 96e41f4b71Sopenharmony_ci| -------- | -------- | 97e41f4b71Sopenharmony_ci| double [OH_HiDebug_GetSystemCpuUsage](#oh_hidebug_getsystemcpuusage) () | 获取系统的CPU资源占用情况百分比。 | 98e41f4b71Sopenharmony_ci| double [OH_HiDebug_GetAppCpuUsage](#oh_hidebug_getappcpuusage) () | 获取进程的CPU使用率百分比。 | 99e41f4b71Sopenharmony_ci| [HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) [OH_HiDebug_GetAppThreadCpuUsage](#oh_hidebug_getappthreadcpuusage) () | 获取应用所有线程CPU使用情况。 | 100e41f4b71Sopenharmony_ci| void [OH_HiDebug_FreeThreadCpuUsage](#oh_hidebug_freethreadcpuusage) ([HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr) \*threadCpuUsage) | 释放线程数据结构。 | 101e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetSystemMemInfo](#oh_hidebug_getsystemmeminfo) ([HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md) \*systemMemInfo) | 获取系统内存信息。 | 102e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetAppNativeMemInfo](#oh_hidebug_getappnativememinfo) ([HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md) \*nativeMemInfo) | 获取应用程序进程的内存信息。 | 103e41f4b71Sopenharmony_ci| void [OH_HiDebug_GetAppMemoryLimit](#oh_hidebug_getappmemorylimit) ([HiDebug_MemoryLimit](_hi_debug___memory_limit.md) \*memoryLimit) | 获取应用程序进程的内存限制。 | 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) | 启动应用trace采集。 | 105e41f4b71Sopenharmony_ci| [HiDebug_ErrorCode](#hidebug_errorcode) [OH_HiDebug_StopAppTraceCapture](#oh_hidebug_stopapptracecapture) () | 停止采集应用程序trace。 | 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci## 宏定义说明 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**描述** 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ciAbility Manager标签。 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 131e41f4b71Sopenharmony_ci 132e41f4b71Sopenharmony_ciJSVM虚拟机标签。 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 144e41f4b71Sopenharmony_ci 145e41f4b71Sopenharmony_ciArkUI开发框架标签。 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci音频模块标签。 159e41f4b71Sopenharmony_ci 160e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 170e41f4b71Sopenharmony_ci 171e41f4b71Sopenharmony_ci蓝牙标签。 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 183e41f4b71Sopenharmony_ci 184e41f4b71Sopenharmony_ci相机模块标签。 185e41f4b71Sopenharmony_ci 186e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci公共库子系统标签。 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ci分布式音频标签。 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci分布式相机标签。 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci分布式数据管理器模块标签。 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ci分布式硬件设备管理器标签。 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 261e41f4b71Sopenharmony_ci 262e41f4b71Sopenharmony_ci分布式硬件框架标签。 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ci分布式输入标签。 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci分布式调度程序标签。 289e41f4b71Sopenharmony_ci 290e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 300e41f4b71Sopenharmony_ci 301e41f4b71Sopenharmony_ci分布式屏幕标签。 302e41f4b71Sopenharmony_ci 303e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 313e41f4b71Sopenharmony_ci 314e41f4b71Sopenharmony_ciFFRT任务标签。 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 326e41f4b71Sopenharmony_ci 327e41f4b71Sopenharmony_ci文件管理标签。 328e41f4b71Sopenharmony_ci 329e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 339e41f4b71Sopenharmony_ci 340e41f4b71Sopenharmony_ci全局资源管理器标签。 341e41f4b71Sopenharmony_ci 342e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 352e41f4b71Sopenharmony_ci 353e41f4b71Sopenharmony_ci图形模块标签。 354e41f4b71Sopenharmony_ci 355e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ciHDF子系统标签。 367e41f4b71Sopenharmony_ci 368e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 378e41f4b71Sopenharmony_ci 379e41f4b71Sopenharmony_ci图像模块标签。 380e41f4b71Sopenharmony_ci 381e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 391e41f4b71Sopenharmony_ci 392e41f4b71Sopenharmony_ci媒体模块标签。 393e41f4b71Sopenharmony_ci 394e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 404e41f4b71Sopenharmony_ci 405e41f4b71Sopenharmony_ciMISC模块标签。 406e41f4b71Sopenharmony_ci 407e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 417e41f4b71Sopenharmony_ci 418e41f4b71Sopenharmony_ci多模态输入模块标签。 419e41f4b71Sopenharmony_ci 420e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 430e41f4b71Sopenharmony_ci 431e41f4b71Sopenharmony_ci网络标签。 432e41f4b71Sopenharmony_ci 433e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 443e41f4b71Sopenharmony_ci 444e41f4b71Sopenharmony_ci通知模块标签。 445e41f4b71Sopenharmony_ci 446e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 456e41f4b71Sopenharmony_ci 457e41f4b71Sopenharmony_ciNWeb标签。 458e41f4b71Sopenharmony_ci 459e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 469e41f4b71Sopenharmony_ci 470e41f4b71Sopenharmony_ciOHOS通用标签。 471e41f4b71Sopenharmony_ci 472e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 482e41f4b71Sopenharmony_ci 483e41f4b71Sopenharmony_ci电源管理器标签。 484e41f4b71Sopenharmony_ci 485e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 495e41f4b71Sopenharmony_ci 496e41f4b71Sopenharmony_ciRPC标签。 497e41f4b71Sopenharmony_ci 498e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 508e41f4b71Sopenharmony_ci 509e41f4b71Sopenharmony_ciSA标签。 510e41f4b71Sopenharmony_ci 511e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 521e41f4b71Sopenharmony_ci 522e41f4b71Sopenharmony_ci窗口管理器标签。 523e41f4b71Sopenharmony_ci 524e41f4b71Sopenharmony_ci**起始版本:** 12 525e41f4b71Sopenharmony_ci 526e41f4b71Sopenharmony_ci 527e41f4b71Sopenharmony_ci## 类型定义说明 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**描述** 537e41f4b71Sopenharmony_ci 538e41f4b71Sopenharmony_ci错误码定义。 539e41f4b71Sopenharmony_ci 540e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 550e41f4b71Sopenharmony_ci 551e41f4b71Sopenharmony_ci应用程序进程内存限制结构类型定义。 552e41f4b71Sopenharmony_ci 553e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 563e41f4b71Sopenharmony_ci 564e41f4b71Sopenharmony_ci应用程序进程本机内存信息结构类型定义。 565e41f4b71Sopenharmony_ci 566e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 576e41f4b71Sopenharmony_ci 577e41f4b71Sopenharmony_ci系统内存信息结构类型定义。 578e41f4b71Sopenharmony_ci 579e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 589e41f4b71Sopenharmony_ci 590e41f4b71Sopenharmony_ci应用程序所有线程的CPU使用率结构体定义。 591e41f4b71Sopenharmony_ci 592e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 602e41f4b71Sopenharmony_ci 603e41f4b71Sopenharmony_ciHiDebug_ThreadCpuUsage指针定义。 604e41f4b71Sopenharmony_ci 605e41f4b71Sopenharmony_ci**起始版本:** 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**描述** 615e41f4b71Sopenharmony_ci 616e41f4b71Sopenharmony_ci采集trace线程的类型。 617e41f4b71Sopenharmony_ci 618e41f4b71Sopenharmony_ci**起始版本:** 12 619e41f4b71Sopenharmony_ci 620e41f4b71Sopenharmony_ci 621e41f4b71Sopenharmony_ci## 枚举类型说明 622e41f4b71Sopenharmony_ci 623e41f4b71Sopenharmony_ci 624e41f4b71Sopenharmony_ci### HiDebug_ErrorCode 625e41f4b71Sopenharmony_ci 626e41f4b71Sopenharmony_ci``` 627e41f4b71Sopenharmony_cienum HiDebug_ErrorCode 628e41f4b71Sopenharmony_ci``` 629e41f4b71Sopenharmony_ci 630e41f4b71Sopenharmony_ci**描述** 631e41f4b71Sopenharmony_ci 632e41f4b71Sopenharmony_ci错误码定义。 633e41f4b71Sopenharmony_ci 634e41f4b71Sopenharmony_ci**起始版本:** 12 635e41f4b71Sopenharmony_ci 636e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 637e41f4b71Sopenharmony_ci| -------- | -------- | 638e41f4b71Sopenharmony_ci| HIDEBUG_SUCCESS | 成功 | 639e41f4b71Sopenharmony_ci| HIDEBUG_INVALID_ARGUMENT | 无效参数,可能的原因: 1.参数传值问题 2.参数类型问题 | 640e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_CAPTURED_ALREADY | 重复采集 | 641e41f4b71Sopenharmony_ci| HIDEBUG_NO_PERMISSION | 没有写文件的权限 | 642e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_ABNORMAL | trace状态异常 | 643e41f4b71Sopenharmony_ci 644e41f4b71Sopenharmony_ci 645e41f4b71Sopenharmony_ci### HiDebug_TraceFlag 646e41f4b71Sopenharmony_ci 647e41f4b71Sopenharmony_ci``` 648e41f4b71Sopenharmony_cienum HiDebug_TraceFlag 649e41f4b71Sopenharmony_ci``` 650e41f4b71Sopenharmony_ci 651e41f4b71Sopenharmony_ci**描述** 652e41f4b71Sopenharmony_ci 653e41f4b71Sopenharmony_ci采集trace线程的类型。 654e41f4b71Sopenharmony_ci 655e41f4b71Sopenharmony_ci**起始版本:** 12 656e41f4b71Sopenharmony_ci 657e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 658e41f4b71Sopenharmony_ci| -------- | -------- | 659e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_FLAG_MAIN_THREAD | 只采集当前应用主线程 | 660e41f4b71Sopenharmony_ci| HIDEBUG_TRACE_FLAG_ALL_THREADS | 采集当前应用下所有线程 | 661e41f4b71Sopenharmony_ci 662e41f4b71Sopenharmony_ci 663e41f4b71Sopenharmony_ci## 函数说明 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**描述** 673e41f4b71Sopenharmony_ci 674e41f4b71Sopenharmony_ci释放线程数据结构。 675e41f4b71Sopenharmony_ci 676e41f4b71Sopenharmony_ci**起始版本:** 12 677e41f4b71Sopenharmony_ci 678e41f4b71Sopenharmony_ci**参数:** 679e41f4b71Sopenharmony_ci 680e41f4b71Sopenharmony_ci| 名称 | 描述 | 681e41f4b71Sopenharmony_ci| -------- | -------- | 682e41f4b71Sopenharmony_ci| threadCpuUsage | 应用的所有线程可用CPU使用缓冲区指针,见[HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr)。 传入的参数是要由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**描述** 692e41f4b71Sopenharmony_ci 693e41f4b71Sopenharmony_ci获取进程的CPU使用率百分比。 694e41f4b71Sopenharmony_ci 695e41f4b71Sopenharmony_ci**起始版本:** 12 696e41f4b71Sopenharmony_ci 697e41f4b71Sopenharmony_ci**返回:** 698e41f4b71Sopenharmony_ci 699e41f4b71Sopenharmony_ci返回进程的CPU使用率百分比。如果返回结果为0,可能的原因是获取失败。 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**描述** 709e41f4b71Sopenharmony_ci 710e41f4b71Sopenharmony_ci获取应用程序进程的内存限制。 711e41f4b71Sopenharmony_ci 712e41f4b71Sopenharmony_ci**起始版本:** 12 713e41f4b71Sopenharmony_ci 714e41f4b71Sopenharmony_ci**参数:** 715e41f4b71Sopenharmony_ci 716e41f4b71Sopenharmony_ci| 名称 | 描述 | 717e41f4b71Sopenharmony_ci| -------- | -------- | 718e41f4b71Sopenharmony_ci| memoryLimit | 表示指向[HiDebug_MemoryLimit](_hi_debug___memory_limit.md)。经过该函数调用,如果结构体里的数据为空,说明调用失败。 | 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**描述** 728e41f4b71Sopenharmony_ci 729e41f4b71Sopenharmony_ci获取应用程序进程的内存信息。 730e41f4b71Sopenharmony_ci 731e41f4b71Sopenharmony_ci**起始版本:** 12 732e41f4b71Sopenharmony_ci 733e41f4b71Sopenharmony_ci**参数:** 734e41f4b71Sopenharmony_ci 735e41f4b71Sopenharmony_ci| 名称 | 描述 | 736e41f4b71Sopenharmony_ci| -------- | -------- | 737e41f4b71Sopenharmony_ci| nativeMemInfo | 表示指向[HiDebug_NativeMemInfo](_hi_debug___native_mem_info.md)。经过该函数调用,如果结构体里的数据为空,说明调用失败。 | 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**描述** 747e41f4b71Sopenharmony_ci 748e41f4b71Sopenharmony_ci获取应用所有线程CPU使用情况。 749e41f4b71Sopenharmony_ci 750e41f4b71Sopenharmony_ci**起始版本:** 12 751e41f4b71Sopenharmony_ci 752e41f4b71Sopenharmony_ci**返回:** 753e41f4b71Sopenharmony_ci 754e41f4b71Sopenharmony_ci返回所有线程CPU使用情况,见[HiDebug_ThreadCpuUsagePtr](#hidebug_threadcpuusageptr)。如果返回的结果是null,说明调用失败。 755e41f4b71Sopenharmony_ci 756e41f4b71Sopenharmony_ci 757e41f4b71Sopenharmony_ci### OH_HiDebug_GetSystemCpuUsage() 758e41f4b71Sopenharmony_ci 759e41f4b71Sopenharmony_ci``` 760e41f4b71Sopenharmony_cidouble OH_HiDebug_GetSystemCpuUsage () 761e41f4b71Sopenharmony_ci``` 762e41f4b71Sopenharmony_ci 763e41f4b71Sopenharmony_ci**描述** 764e41f4b71Sopenharmony_ci 765e41f4b71Sopenharmony_ci获取系统的CPU资源占用情况百分比。 766e41f4b71Sopenharmony_ci 767e41f4b71Sopenharmony_ci**起始版本:** 12 768e41f4b71Sopenharmony_ci 769e41f4b71Sopenharmony_ci**返回:** 770e41f4b71Sopenharmony_ci 771e41f4b71Sopenharmony_ci返回系统CPU资源占用情况百分比。如果返回结果为0,可能的原因是获取失败。 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**描述** 780e41f4b71Sopenharmony_ci 781e41f4b71Sopenharmony_ci获取系统内存信息。 782e41f4b71Sopenharmony_ci 783e41f4b71Sopenharmony_ci**起始版本:** 12 784e41f4b71Sopenharmony_ci 785e41f4b71Sopenharmony_ci**参数:** 786e41f4b71Sopenharmony_ci 787e41f4b71Sopenharmony_ci| 名称 | 描述 | 788e41f4b71Sopenharmony_ci| -------- | -------- | 789e41f4b71Sopenharmony_ci| systemMemInfo | 表示指向[HiDebug_SystemMemInfo](_hi_debug___system_mem_info.md)。经过该函数调用,如果结构体里的数据为空,说明调用失败。| 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**描述** 799e41f4b71Sopenharmony_ci 800e41f4b71Sopenharmony_ci启动应用trace采集。 801e41f4b71Sopenharmony_ci 802e41f4b71Sopenharmony_ci**起始版本:** 12 803e41f4b71Sopenharmony_ci 804e41f4b71Sopenharmony_ci**参数:** 805e41f4b71Sopenharmony_ci 806e41f4b71Sopenharmony_ci| 名称 | 描述 | 807e41f4b71Sopenharmony_ci| -------- | -------- | 808e41f4b71Sopenharmony_ci| flag | 采集线程trace方式。 | 809e41f4b71Sopenharmony_ci| tags | 采集trace场景标签。 | 810e41f4b71Sopenharmony_ci| limitSize | trace文件的最大大小(以字节为单位),最大为 500MB。 | 811e41f4b71Sopenharmony_ci| fileName | 输出trace文件名缓冲区。 | 812e41f4b71Sopenharmony_ci| length | 输出trace文件名缓冲区长度。 | 813e41f4b71Sopenharmony_ci 814e41f4b71Sopenharmony_ci**返回:** 815e41f4b71Sopenharmony_ci 816e41f4b71Sopenharmony_ci0 - 成功。 401 - fileName参数为空指针或者传入的length参数过小或者limitSize参数小于等于0。 11400102 - 已经开启了一个trace。 11400103 - 没有权限去开启trace。 11400104 - 系统内部错误。 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**描述** 826e41f4b71Sopenharmony_ci 827e41f4b71Sopenharmony_ci停止采集应用程序trace。 828e41f4b71Sopenharmony_ci 829e41f4b71Sopenharmony_ci**起始版本:** 12 830e41f4b71Sopenharmony_ci 831e41f4b71Sopenharmony_ci**返回:** 832e41f4b71Sopenharmony_ci 833e41f4b71Sopenharmony_ci0 - 成功 11400104 - 系统内部的原因 11400105 - 没有trace正在采集。 834e41f4b71Sopenharmony_ci 835e41f4b71Sopenharmony_ci### OH_HiDebug_GetGraphicsMemory(); 836e41f4b71Sopenharmony_ci``` 837e41f4b71Sopenharmony_ciHiDebug_ErrorCode OH_HiDebug_GetGraphicsMemory(uint32_t *value); 838e41f4b71Sopenharmony_ci``` 839e41f4b71Sopenharmony_ci 840e41f4b71Sopenharmony_ci**描述** 841e41f4b71Sopenharmony_ci 842e41f4b71Sopenharmony_ci获取应用gpu显存大小。 843e41f4b71Sopenharmony_ci 844e41f4b71Sopenharmony_ci**起始版本:** 13 845e41f4b71Sopenharmony_ci 846e41f4b71Sopenharmony_ci**参数:** 847e41f4b71Sopenharmony_ci 848e41f4b71Sopenharmony_ci| 名称 | 描述 | 849e41f4b71Sopenharmony_ci| -------- |---------------------------------| 850e41f4b71Sopenharmony_ci| value | 指向用来保存接口获取到的应用显存大小(单位KB)的变量的指针。 | 851e41f4b71Sopenharmony_ci 852e41f4b71Sopenharmony_ci**返回:** 853e41f4b71Sopenharmony_ci 854e41f4b71Sopenharmony_ci0 - 成功 401 - 传入参数无效 11400104 - 系统内部异常。