diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index cfc769777b5733c6f2772eb62e10b459256d5ad9..f9ef2a27c47d811072baa4090f48e70e47e027dd 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -26,13 +26,9 @@ * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ - /** - * This module provides multiple methods for debugging and profiling applications. With these methods, you can obtain - * memory, CPU, GPU, and GC data, collect process trace and profiler data, and dump VM heap snapshots. Since most APIs - * of this module are both performance-consuming and time-consuming, and are defined based on the HiDebug module, - * you are advised to use these APIs only during the application debugging and profiling phases. If the APIs are - * required in other scenarios, evaluate the impact of the APIs on application performance. + * Provide interfaces related to debugger access and obtaining CPU, + * memory and other virtual machine information during runtime for JS programs * * @namespace hidebug * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -41,92 +37,82 @@ */ declare namespace hidebug { /** - * Obtains the total number of bytes occupied by the total space (the sum of uordblks and fordblks obtained from - * mallinfo) held by a process, which is measured by the memory allocator. + * Get total native heap memory size * - * @returns { bigint } Returns the total number of bytes occupied by the total space. + * @returns { bigint } Returns total native heap memory size. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ function getNativeHeapSize(): bigint; /** - * Obtains the total number of bytes occupied by the total allocated space (uordblks obtained from mallinfo) held by - * a process, which is measured by the memory allocator. - * @returns { bigint } Returns the total number of bytes occupied by the total allocated space. + * Get Native heap memory allocation size. + * @returns { bigint } Returns native heap memory allocation size. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ function getNativeHeapAllocatedSize(): bigint; /** - * Obtains the total number of bytes occupied by the total free space (fordblks obtained from mallinfo) - * held by a process, which is measured by the memory allocator. + * Get Native heap memory free size * - * @returns { bigint } Returns the size of the memory occupied by the free normal blocks held by the process, in bytes. + * @returns { bigint } Returns native heap memory free size. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ function getNativeHeapFreeSize(): bigint; /** - * Obtains the virtual set size used by the application process. This API is implemented by multiplying the value of - * size (number of memory pages) in the /proc/{pid}/statm node by the page size (4 KB per page). + * Get the virtual set size memory of the application process * - * @returns { bigint } Returns the virtual set size used by the application process, in KB. + * @returns { bigint } Returns application process virtual set size memory information. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 11 */ function getVss(): bigint; /** - * Obtains the size of the physical memory actually used by the application process. This API is implemented by - * summing up the values of **Pss** and **SwapPss** in the /proc/{pid}/smaps_rollup** node. + * Get application process proportional set size memory information * - * @returns { bigint } Returns the size of the physical memory actually used by the application process, in KB. + * @returns { bigint } Returns application process proportional set size memory information. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ function getPss(): bigint; /** - * Obtains the size of the shared dirty memory of a process. This API is implemented by reading the value of - * Shared_Dirty in the /proc/{pid}/smaps_rollup node. + * Obtains the size of the shared dirty memory of a process. * - * @returns { bigint } Returns the size of the shared dirty memory of the process, in KB. + * @returns { bigint } Returns the size of the shared dirty memory. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 */ function getSharedDirty(): bigint; /** - * Obtains the size of the private dirty memory of a process. This API is implemented by reading the value of - * Private_Dirty in the /proc/{pid}/smaps_rollup node. - * - * @returns { bigint } Returns the size of the private dirty memory of the process, in KB. + * Obtains the size of the private dirty memory of a process. + * @returns { bigint } Returns the size of the private dirty memory. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 */ function getPrivateDirty(): bigint; /** - * Obtains the CPU usage of a process. + * Obtains the cpu usage percent of a process. * - * @returns { number } Returns the CPU usage of the process. + * @returns { number } Returns the cpu usage of a process. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 */ function getCpuUsage(): number; /** + * Start CPU Profiling. + * The input parameter is a user-defined file name, excluding the file suffix. + * The generated file is in the files folder under the application directory. + * Such as "/data/accounts/account_0/appdata/[package name]/files/cpuprofiler-xxx.json" * - * Starts the VM profiling method. startProfiling(filename: string) and stopProfiling() are called in pairs. - * startProfiling(filename: string) always occurs before stopProfiling(). You are advised not to call either of these - * methods repeatedly. Otherwise, an exception may occur. The generated file is in the files folder under the - * application directory. Such as "/data/accounts/account_0/appdata/[package name]/files/cpuprofiler-xxx.json" - * - * @param { string } filename - User-defined file name of the sampling data. The .json file is generated - * in the files directory of the application based on the specified file name. + * @param { string } filename - Indicates the user-defined file name, excluding the file suffix. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 * @deprecated since 9 @@ -135,9 +121,8 @@ declare namespace hidebug { function startProfiling(filename: string): void; /** - * Stops the VM profiling method. stopProfiling() and startProfiling(filename: string) are called in pairs. - * startProfiling(filename: string) always occurs before stopProfiling(). You are advised not to call either of these - * methods repeatedly. Otherwise, an exception may occur. It takes effect only when the CPU profiler is turned on. + * Stop CPU Profiling. + * It takes effect only when the CPU profiler is turned on * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 8 @@ -147,10 +132,10 @@ declare namespace hidebug { function stopProfiling(): void; /** - * Exports the VM heap data and generates a filename.heapsnapshot file. + * Dump JS Virtual Machine Heap Snapshot. * The input parameter is a user-defined file name, excluding the file suffix. * The generated file is in the files folder under the application directory. - * Such as "/data/accounts/account_0/appdata/[package name]/files/xxx.heapsnapshot". + * Such as "/data/accounts/account_0/appdata/[package name]/files/xxx.heapsnapshot" * * @param { string } filename - Indicates the user-defined file name, excluding the file suffix. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -161,12 +146,11 @@ declare namespace hidebug { function dumpHeapData(filename: string): void; /** - * Starts the VM profiling method. startJsCpuProfiling(filename: string) and stopJsCpuProfiling() are called in pairs. - * startJsCpuProfiling(filename: string) always occurs before stopJsCpuProfiling(). You are advised not to call either - * of these methods repeatedly. Otherwise, an exception may occur. + * Start CPU Profiling. + * The input parameter is a user-defined file name, excluding the file suffix. + * The generated file is in the files folder under the application directory. * - * @param { string } filename - User-defined heap file name. The .heapsnapshot file is generated in the files - * directory of the application based on the specified file name. + * @param { string } filename - Indicates the user-defined file name, excluding the file suffix. * @throws {BusinessError} 401 - the parameter check failed, Parameter type error * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 @@ -174,9 +158,8 @@ declare namespace hidebug { function startJsCpuProfiling(filename: string): void; /** - * Stops the VM profiling method. stopJsCpuProfiling() and startJsCpuProfiling(filename: string) are called in pairs. - * startJsCpuProfiling() always occurs before stopJsCpuProfiling(). You are advised not to call either of these - * methods repeatedly. Otherwise, an exception may occur. It takes effect only when the CPU profiler is turned on + * Stop CPU Profiling. + * It takes effect only when the CPU profiler is turned on * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 @@ -184,30 +167,29 @@ declare namespace hidebug { function stopJsCpuProfiling(): void; /** - * Exports the heap data. + * Dump JS Virtual Machine Heap Snapshot. * The input parameter is a user-defined file name, excluding the file suffix. * The generated file is in the files folder under the application directory. * - * @param { string } filename - User-defined file name of the sampling data. The .heapsnapshot file is generated - * in the files directory of the application based on the specified file name. - * @throws {BusinessError} 401 - the parameter check failed, Parameter type error. + * @param { string } filename - Indicates the user-defined file name, excluding the file suffix. + * @throws {BusinessError} 401 - the parameter check failed, Parameter type error * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 */ function dumpJsHeapData(filename: string): void; /** - * Obtains system service information. + * Get a debugging dump of a system service by service id. * It need dump permission. * This API can be called only by system application. * * @permission ohos.permission.DUMP - * @param { number } serviceid - Obtains the system service information based on the specified service ID. - * @param { number } fd - File descriptor to which data is written by the API. - * @param { Array } args - Parameter list of the Dump API of the system service. - * @throws {BusinessError} 401 - the parameter check failed,Possible causes: + * @param { number } serviceid - Indicates the id of the service ability. + * @param { number } fd - The file descriptor. + * @param { Array } args - The args list of the system ability dump interface. + * @throws {BusinessError} 401 - the parameter check failed, Possible causes: * 1.the parameter type error - * 2.the args parameter is not string array. + * 2.the args parameter is not string array * @throws {BusinessError} 11400101 - ServiceId invalid. The system ability does not exist. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 9 @@ -215,9 +197,9 @@ declare namespace hidebug { function getServiceDump(serviceid: number, fd: number, args: Array): void; /** - * Obtains the CPU usage of the system. + * Obtains the cpu usage of system. * - * @returns { number } Returns the CPU usage of the system. + * @returns { number } Returns the cpu usage of system. * @throws { BusinessError } 11400104 - The status of the system CPU usage is abnormal. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 @@ -225,7 +207,7 @@ declare namespace hidebug { function getSystemCpuUsage(): number; /** - * Describes the CPU usage of a thread. + * Application CPU usage of thread. * * @interface ThreadCpuUsage * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -241,7 +223,7 @@ declare namespace hidebug { */ threadId: number; /** - * CPU usage of the thread. + * Cpu usage of thread * * @type { number } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -251,16 +233,16 @@ declare namespace hidebug { } /** - * Obtains the CPU usage of application threads. + * Get the CPU usage of all threads in the application. * - * @returns { ThreadCpuUsage[] } Returns the CPU usage of all threads of the current application process. + * @returns { ThreadCpuUsage[] } Returns the CPU usage of all threads in the application. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getAppThreadCpuUsage(): ThreadCpuUsage[]; /** - * Describes the system memory information, including the total memory, free memory, and available memory. + * System memory information * * @interface SystemMemInfo * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -268,8 +250,7 @@ declare namespace hidebug { */ interface SystemMemInfo { /** - * Total memory of the system, in KB. The value of this parameter is obtained by reading the value of - * MemTotal in the /proc/meminfo node. + * Total system memory size, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -277,8 +258,7 @@ declare namespace hidebug { */ totalMem: bigint; /** - * Free memory of the system, in KB. The value of this parameter is obtained by reading the value of - * MemFree in the /proc/meminfo node. + * System free memory size, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -286,8 +266,7 @@ declare namespace hidebug { */ freeMem: bigint; /** - * Available memory of the system, in KB. The value of this parameter is obtained by reading the value of - * MemAvailable in the /proc/meminfo node. + * System available memory size, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -297,16 +276,16 @@ declare namespace hidebug { } /** - * Obtains system memory information. This API is implemented by reading data from the /proc/meminfo node. + * Obtains the system memory size. * - * @returns { SystemMemInfo } Returns the system memory information. + * @returns { SystemMemInfo } Returns system memory size. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getSystemMemInfo(): SystemMemInfo; /** - * Describes memory information of the application process. + * Application process native memory information. * * @interface NativeMemInfo * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -314,9 +293,7 @@ declare namespace hidebug { */ interface NativeMemInfo { /** - * Size of the occupied physical memory (including the proportionally allocated memory occupied by the shared - * library), in KB. The value of this parameter is obtained by summing up the values of Pss and SwapPss in the - * /proc/{pid}/smaps_rollup node. + * Process proportional set size memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -324,9 +301,7 @@ declare namespace hidebug { */ pss: bigint; /** - * Size of the occupied virtual memory (including the memory occupied by the shared library), in KB. The value of - * this parameter is obtained by multiplying the value of size (number of memory pages) in the /proc/{pid}/statm - * node by the page size (4 KB per page). + * Virtual set size memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -334,8 +309,7 @@ declare namespace hidebug { */ vss: bigint; /** - * Size of the occupied physical memory (including the memory occupied by the shared library), in KB. - * The value of this parameter is obtained by reading the value of Rss in the /proc/{pid}/smaps_rollup node. + * Resident set size, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -343,8 +317,7 @@ declare namespace hidebug { */ rss: bigint; /** - * Size of the shared dirty memory, in KB. The value of this parameter is obtained by reading the value of - * Shared_Dirty in the /proc/{pid}/smaps_rollup node. + * The size of the shared dirty memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -352,8 +325,7 @@ declare namespace hidebug { */ sharedDirty: bigint; /** - * Size of the private dirty memory, in KB. The value of this parameter is obtained by reading the value of - * Private_Dirty in the /proc/{pid}/smaps_rollup node. + * The size of the private dirty memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -361,8 +333,7 @@ declare namespace hidebug { */ privateDirty: bigint; /** - * Size of the shared clean memory, in KB. The value of this parameter is obtained by reading the value of - * Shared_Clean in the /proc/{pid}/smaps_rollup node. + * The size of the shared clean memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -370,8 +341,7 @@ declare namespace hidebug { */ sharedClean: bigint; /** - * Size of the private clean memory, in KB. The value of this parameter is obtained by reading the value of - * Private_Clean in the /proc/{pid}/smaps_rollup node. + * The size of the private clean memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -381,17 +351,16 @@ declare namespace hidebug { } /** - * Obtains the memory information of the application process. This API is implemented by reading data from the - * /proc/{pid}/smaps_rollup and /proc/{pid}/statm node. + * Obtains the memory information of application process. * - * @returns { NativeMemInfo } Returns the memory information of the application process. + * @returns { NativeMemInfo } Returns the native memory of a process. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getAppNativeMemInfo(): NativeMemInfo; /** - * Defines the memory limit of the application process. + * Application process memory limit * * @interface MemoryLimit * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -399,7 +368,7 @@ declare namespace hidebug { */ interface MemoryLimit { /** - * Limit on the resident set size, in KB. + * The limit of the application process's resident set, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -407,7 +376,7 @@ declare namespace hidebug { */ rssLimit: bigint; /** - * Limit on the virtual memory size, in KB. + * The limit of the application process's virtual memory, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -415,7 +384,7 @@ declare namespace hidebug { */ vssLimit: bigint; /** - * Limit on the JS VM heap size of the calling thread, in KB. + * The limit of the js vm heap size of current virtual machine, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -423,7 +392,7 @@ declare namespace hidebug { */ vmHeapLimit: bigint; /** - * Size limit of the JS heap memory of the process, in KB. + * The limit of the total js vm heap size of process, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -433,16 +402,16 @@ declare namespace hidebug { } /** - * Obtains the memory limit of an application process. + * Obtains the memory limit of application process. * - * @returns { MemoryLimit } Returns the memory limit of the application process. + * @returns { MemoryLimit } Returns memory limit of application. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getAppMemoryLimit(): MemoryLimit; /** - * Describes the VM memory information. + * The memory information of application virtual machine. * * @interface VMMemoryInfo * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -450,7 +419,7 @@ declare namespace hidebug { */ interface VMMemoryInfo { /** - * Total heap size of the current VM, in KB. + * Total size of current virtual machine Heap, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -458,7 +427,7 @@ declare namespace hidebug { */ totalHeap: bigint; /** - * Heap size used by the current VM, in KB. + * Used size of current virtual machine Heap, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -466,7 +435,7 @@ declare namespace hidebug { */ heapUsed: bigint; /** - * Size of all array objects of the current VM, in KB. + * All array object size of current virtual machine, in kilobyte * * @type { bigint } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -476,16 +445,39 @@ declare namespace hidebug { } /** - * Obtains VM memory information. + * Obtains the memory information of application virtual machine. * - * @returns { VMMemoryInfo } Returns the VM memory information. + * @returns { VMMemoryInfo } Returns memory information of application virtual machine. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getAppVMMemoryInfo(): VMMemoryInfo; /** - * Describes types of trace collection threads, including the main thread and all threads. + * Obtains the memory information of the application process asynchronous. This API is implemented + * by reading data from the /proc/{pid}/smaps_rollup and /proc/{pid}/statm node. + * + * @returns { Promise } Returns the memory information of the application process. + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + function getAppNativeMemInfoAsync(): Promise; + + /** + * Obtains the memory information of the application process. This API is implemented by reading data from the + * /proc/{pid}/smaps_rollup and /proc/{pid}/statm node. The application memory cache is refresh every 5 minute. + * It will be force to refresh when input true of forceRefresh parameter. + * + * @param { boolean } [forceRefresh] Whether forceRefresh is required when application memeory cache + * need to refresh. The default value is false. + * @returns { NativeMemInfo } Returns the memory information of the application process. + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + function getAppNativeMemInfoWithCache(forceRefresh?: boolean): NativeMemInfo; + + /** + * Enum for trace flag * * @enum { number } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -493,14 +485,14 @@ declare namespace hidebug { */ enum TraceFlag { /** - * The main thread of the application. + * Only capture main thread trace * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ MAIN_THREAD = 1, /** - * All threads of the application. + * Capture all thread trace * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 @@ -509,7 +501,7 @@ declare namespace hidebug { } /** - * Enumerates the tags used in trace collection. + * Provide trace tags * * @namespace tags * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -517,224 +509,224 @@ declare namespace hidebug { */ namespace tags { /** - * Ability Manager tag. The corresponding HiTrace command is tagName:ability. + * Ability Manager tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const ABILITY_MANAGER: number; /** - * ArkUI development framework. The corresponding HiTrace command is tagName:ace. + * ARKUI development framework tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const ARKUI: number; /** - * JSVM VM. The corresponding HiTrace command is tagName:ark. + * ARK tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const ARK: number; /** - * Bluetooth. The corresponding HiTrace command is tagName:bluetooth. + * Bluetooth tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const BLUETOOTH: number; /** - * Common library subsystem. The corresponding HiTrace command is tagName:commonlibrary. + * Common library subsystem tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const COMMON_LIBRARY: number; /** - * Distributed hardware device management. The corresponding HiTrace command is tagName:devicemanager. + * Distributed hardware device manager tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_HARDWARE_DEVICE_MANAGER: number; /** - * Distributed audio. The corresponding HiTrace command is tagName:daudio. + * Distributed audio tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_AUDIO: number; /** - * Distributed camera. The corresponding HiTrace command is tagName:dcamera. + * Distributed camera tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_CAMERA: number; /** - * Distributed data management. The corresponding HiTrace command is tagName:distributeddatamgr. + * Distributed data manager module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_DATA: number; /** - * Distributed hardware framework. The corresponding HiTrace command is tagName:dhfwk. + * Distributed hardware framework tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_HARDWARE_FRAMEWORK: number; /** - * Distributed input. The corresponding HiTrace command is tagName:dinput. + * Distributed input tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_INPUT: number; /** - * Distributed screen. The corresponding HiTrace command is tagName:dscreen. + * Distributed screen tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_SCREEN: number; /** - * Distributed scheduler. The corresponding HiTrace command is tagName:dsched. + * Distributed scheduler tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const DISTRIBUTED_SCHEDULER: number; /** - * FFRT task. The corresponding HiTrace command is tagName:ffrt. + * FFRT tasks. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const FFRT: number; /** - * File management system. The corresponding HiTrace command is tagName:filemanagement. + * File management tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const FILE_MANAGEMENT: number; /** - * Global resource management. The corresponding HiTrace command is tagName:gresource. + * Global resource manager tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const GLOBAL_RESOURCE_MANAGER: number; /** - * Graphics module. The corresponding HiTrace command is tagName:graphic. + * Graphics module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const GRAPHICS: number; /** - * HDF subsystem. The corresponding HiTrace command is tagName:hdf. + * HDF subsystem tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const HDF: number; /** - * MISC module. The corresponding HiTrace command is tagName:misc. + * MISC module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const MISC: number; /** - * Multi-modal input module. The corresponding HiTrace command is tagName:multimodalinput. + * Multimodal input module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const MULTIMODAL_INPUT: number; /** - * Network. The corresponding HiTrace command is tagName:net. + * Net tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const NET: number; /** - * Notification module. The corresponding HiTrace command is tagName:notification. + * Notification module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const NOTIFICATION: number; /** - * Nweb. The corresponding HiTrace command is tagName:nweb. + * NWeb tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const NWEB: number; /** - * OHOS. The corresponding HiTrace command is tagName:ohos. + * OHOS generic tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const OHOS: number; /** - * Power management. The corresponding HiTrace command is tagName:power. + * Power manager tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const POWER_MANAGER: number; /** - * RPC. The corresponding HiTrace command is tagName:rpc. + * RPC tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const RPC: number; /** - * System capability management. The corresponding HiTrace command is tagName:samgr. + * SA tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const SAMGR: number; /** - * Window management. The corresponding HiTrace command is tagName:window. + * Window manager tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const WINDOW_MANAGER: number; /** - * Audio module. The corresponding HiTrace command is tagName:zaudio. + * Audio module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const AUDIO: number; /** - * Camera module. The corresponding HiTrace command is tagName:zcamera. + * Camera module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const CAMERA: number; /** - * Image module. The corresponding HiTrace command is tagName:zimage. + * Image module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ const IMAGE: number; /** - * Media module. The corresponding HiTrace command is tagName:zmedia. + * Media module tag. * * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 @@ -743,15 +735,12 @@ declare namespace hidebug { } /** - * Starts automatic trace collection in a specified scope. This API is a supplement to the HiTrace module. - * The performance consumption during trace collection increases with the collection scope. Therefore, before - * using this API, you are advised to run the hitrace command to capture trace logs and select the key scope - * of trace collection to improve the API performance. + * Start capture application trace. * - * @param { number[] } tags - Scope for trace collection. For details, see tags. - * @param { TraceFlag } flag - For details, see TraceFlag. - * @param { number } limitSize - Limit on the trace file size, in bytes. The maximum size of a single file is 500 MB. - * @returns { string } Returns the path of the trace file. + * @param { number[] } tags - Tag of trace. + * @param { TraceFlag } flag - Trace flag. + * @param { number } limitSize - Max size of trace file, in bytes, the max is 500MB. + * @returns { string } Returns absolute path of the trace file. * @throws { BusinessError } 401 - Invalid argument, Possible causes: * 1.The limit parameter is too small * 2.The parameter is not within the enumeration type @@ -765,19 +754,17 @@ declare namespace hidebug { function startAppTraceCapture(tags: number[], flag: TraceFlag, limitSize: number): string; /** - * Stops application trace collection. Use startAppTraceCapture() to start collection before calling this API. - * If this API is called before trace collection or it is repeatedly called, an exception will occur. + * Stop capture application trace. * - * @throws { BusinessError } 11400104 - The status of the trace is abnormal. - * @throws { BusinessError } 11400105 - No capture trace running. + * @throws { BusinessError } 11400104 - The status of the trace is abnormal + * @throws { BusinessError } 11400105 - No capture trace running * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function stopAppTraceCapture(): void; /** - * Describes the key-value pair used to store GC statistics. This type does not support multi-thread operations. - * If this type is operated by multiple threads at the same time in an application, use a lock for it. + * Collection statistics. * * @typedef { Record } GcStats * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -786,19 +773,19 @@ declare namespace hidebug { type GcStats = Record; /** - * Obtains all system GC statistics. + * Get the garbage collection statistics. * - * @returns { GcStats } Returns the system GC statistics. + * @returns { GcStats } Returns garbage collection statistics. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function getVMRuntimeStats(): GcStats; /** - * Obtains the specified system GC statistics based on parameters. + * Get the garbage collection statistics by statistical item. * * @param { string } item - statistical item. - * @returns { number } Returns the item of the GC statistics to be obtained. + * @returns { number } Returns garbage collection statistics. * @throws { BusinessError } 401 - Possible causes: * 1. Invalid parameter, a string parameter required. * 2. Invalid parameter, unknown property. @@ -808,10 +795,11 @@ declare namespace hidebug { function getVMRuntimeStat(item: string): number; /** - * Sets the number of FDs, number of threads, JS memory, or native memory limit of the application. - * - * @param { string } type - resource type. It could be pss_memory、js_heap、fd、or thread. - * @param { int } value - For different resource type, values could have different meaning: + * Set the resource limitation of application.Please note that this function is only valid + * when the developer options switch of setting is turned on. + * + * @param { string } type - resource type. It could be pss_memoryjs_heapfdor thread. + * @param { number } value - For different resource type, values could have different meaning: * 1.For pss_memory, it means the baseline PSS memory size for the application, * system memory control will be triggered if exceed the value too much. * 2.For js_heap, it means the percentage of the used JS heap memory to the maximum limit exceed @@ -829,22 +817,21 @@ declare namespace hidebug { * @atomicservice * @since 12 */ - function setAppResourceLimit(type: string, value: int, enableDebugLog: boolean): void; + function setAppResourceLimit(type: string, value: number, enableDebugLog: boolean): void; /** - * Obtains the debugging state of an application process. If the Ark or native layer of the application process is in - * debugging state, true is returned. Otherwise, false is returned. + * Judge if the application is in debugged state, including either in arkui layer or native layer debugged state. * - * @returns { boolean } true if the application is in the debugging state. + * @returns { boolean } true if the application is debugged. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 12 */ function isDebugState(): boolean; /** - * Obtains the size of the GPU memory. This API uses a promise to return the result. + * Get the graphics memory of application * - * @returns { Promise } Returns the size of the GPU memory, in KB. + * @returns { Promise } Returns the graphics memory of application, in kilobyte. * @throws { BusinessError } 11400104 - Failed to get the application memory due to a remote exception. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @atomicservice @@ -853,9 +840,9 @@ declare namespace hidebug { function getGraphicsMemory(): Promise; /** - * Obtains the size of the GPU memory synchronously. + * Get the graphics memory of application * - * @returns { number } Returns the size of the GPU memory, in KB. + * @returns { number } Returns the graphics memory of application, in kilobyte. * @throws { BusinessError } 11400104 - Failed to get the application memory due to a remote exception. * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @atomicservice @@ -864,17 +851,17 @@ declare namespace hidebug { function getGraphicsMemorySync(): number; /** - * Dumps the original heap snapshot of the VM for the current thread. The API uses a promise to return the path of the - * .rawheap file. You can use rawheap-translator to convert the generated file into a .heapsnapshot file for parsing. + * Dump the raw heap snapshot of the JavaScript Virtual Machine for the current thread. + * * The generated file will be stored in a folder within the application directory. However, since this file is usually * large, the system imposes restrictions on the frequency and number of calls to this function. Consequently, you * might fail to obtain the dump file due to quota limitations. These failures will persist until the quota is * regularly refreshed by the system. Therefore, it is advisable to delete the file immediately after you have * finished processing it. Moreover, it is recommended that you use this function in the gray - release version. * - * @param { boolean } needGC - Whether GC is required when a heap snapshot is dumped. The default value is true. - * If this parameter is not specified, GC is triggered before dumping. - * @returns { Promise } Returns the path of the generated snapshot file. + * @param { boolean } needGC - Whether do GC before dump, default is true. + * @returns { Promise } Returns the full path of raw heap snapshot file. + * @throws { BusinessError } 401 - Invalid parameter. * @throws { BusinessError } 11400106 - Quota exceeded. * @throws { BusinessError } 11400107 - Fork operation failed. * @throws { BusinessError } 11400108 - Failed to wait for the child process to finish. @@ -888,103 +875,6 @@ declare namespace hidebug { * @since 18 */ function dumpJsRawHeapData(needGC?: boolean): Promise; - - /** - * GwpAsan Options. - * - * @interface GwpAsanOptions - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - interface GwpAsanOptions { - /** - * Control whether to enable GWP-ASan every time - * - * @type { ?boolean } - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - alwaysEnabled?: boolean; - /** - * sample rate of GWP-ASAN - * - * @type { ?number } - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - sampleRate?: number; - /** - * the max simutaneous allocations of GWP-ASAN - * - * @type { ?number } - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - maxSimutaneousAllocations?: number; - } - - /** - * Enable the GWP-ASAN grayscale of your application. - * @param { GwpAsanOptions } [options] - The options of GWP-ASAN grayscale. - * @param { number } [duration] - The duration days of GWP-ASAN grayscale. - * @throws { BusinessError } 11400114 - The number of GWP-ASAN applications of this device overflowed after last boot. - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - function enableGwpAsanGrayscale(options?: GwpAsanOptions, duration?: number): void; - - /** - * Disable the GWP-ASAN grayscale of your application. - * - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - function disableGwpAsanGrayscale(): void; - - /** - * Obtain the remaining days of GWP-ASan grayscale for your application. - * - * @returns { number } The remaining days of GWP-ASan grayscale. - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - function getGwpAsanGrayscaleState(): number; - - /** - * Trimming level of raw heap snapshot. - * - * @enum { number } - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - enum JsRawHeapTrimLevel { - /** - * Basic heap snapshot trimming(e.g. reducing content of string object). - * - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - TRIM_LEVEL_1 = 0, - /** - * On top of level 1 trimming, object address size has been additionally trimmed. - * Please use latest version of rawheap-translator tool for parsing and converting - * .rawheap into .heapsnapshot file. Conversion process may fail when legacy tool is utilized. - * - * A higher trimming level means a longer time needed to generate the .rawheap file. - * Ensure that this duration falls below the app freeze threshold. - * - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - TRIM_LEVEL_2 = 1, - } - - /** - * Sets the raw heap snapshot trimming level for the current process. - * @param { JsRawHeapTrimLevel } level - The trimming level of raw heap snapshot. - * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 - */ - function setJsRawHeapTrimLevel(level: JsRawHeapTrimLevel): void; } -export default hidebug; + +export default hidebug; \ No newline at end of file