diff --git a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md index 66306729dc0da5f124d69eb0f9865c17b4259048..00157671eb6ecd995e45917b4ea767ff766871e1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md @@ -19,8 +19,6 @@ getNativeHeapSize(): bigint 获取本应用堆内存的总大小。 -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。 - **系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug **返回值:** @@ -42,8 +40,6 @@ getNativeHeapAllocatedSize(): bigint 获取本应用堆内存的已分配内存大小。 -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。 - **系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug **返回值:** @@ -65,8 +61,6 @@ getNativeHeapFreeSize(): bigint 获取本应用堆内存的空闲内存大小。 -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。 - **系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug **返回值:** @@ -163,76 +157,6 @@ getCpuUsage(): number let cpuUsage = hidebug.getCpuUsage(); ``` -## hidebug.startProfiling(deprecated) - -startProfiling(filename : string) : void - -> **说明:** 从 API Version 9 开始废弃,建议使用[hidebug.startJsCpuProfiling](#hidebugstartjscpuprofiling9)替代。 - -启动虚拟机Profiling方法跟踪,`startProfiling()`方法的调用需要与`stopProfiling()`方法的调用一一对应,先开启后关闭,严禁使用`start->start->stop`,`start->stop->stop`,`start->start->stop->stop`等类似的顺序调用。 - -**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ------------------------------------------------------------ | -| filename | string | 是 | 用户自定义的profiling文件名,根据传入的`filename`,将在应用的`files`目录生成`filename.json`文件。 | - -**示例:** - -```js -hidebug.startProfiling("cpuprofiler-20220216"); -// code block -// ... -// code block -hidebug.stopProfiling(); -``` - - - -## hidebug.stopProfiling(deprecated) - -stopProfiling() : void - -> **说明:** 从 API Version 9 开始废弃,建议使用[hidebug.stopJsCpuProfiling](#hidebugstopjscpuprofiling9)替代。 - -停止虚拟机Profiling方法跟踪,`stopProfiling()`方法的调用需要与`startProfiling()`方法的调用一一对应,先开启后关闭,严禁使用`start->start->stop`,`start->stop->stop`,`start->start->stop->stop`等类似的顺序调用。 - -**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug - -**示例:** - -```js -hidebug.startProfiling("cpuprofiler-20220216"); -// code block -// ... -// code block -hidebug.stopProfiling(); -``` - -## hidebug.dumpHeapData(deprecated) - -dumpHeapData(filename : string) : void - -> **说明:** 从 API Version 9 开始废弃,建议使用[hidebug.dumpJsHeapData](#hidebugdumpjsheapdata9)替代。 - -虚拟机堆导出。 - -**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ------------------------------------------------------------ | -| filename | string | 是 | 用户自定义的虚拟机堆文件名,根据传入的`filename`,将在应用的`files`目录生成`filename.heapsnapshot`文件。 | - -**示例:** - -```js -hidebug.dumpHeapData("heap-20220216"); -``` - ## hidebug.getServiceDump9+ getServiceDump(serviceid : number, fd : number, args : Array\) : void @@ -251,7 +175,6 @@ getServiceDump(serviceid : number, fd : number, args : Array\) : void | fd | number | 是 | 文件描述符,该接口会往该fd中写入数据。| | args | Array\ | 是 | 系统服务的Dump接口所对应的参数列表。| - **示例:** ```js @@ -359,4 +282,80 @@ try { console.info(error.code) console.info(error.message) } -``` \ No newline at end of file +``` + +## hidebug.startProfiling(deprecated) + +startProfiling(filename : string) : void + +> **说明:** +> +> 从 API version 9 开始废弃,建议使用[hidebug.startJsCpuProfiling](#hidebugstartjscpuprofiling9)替代。 + +启动虚拟机Profiling方法跟踪,`startProfiling()`方法的调用需要与`stopProfiling()`方法的调用一一对应,先开启后关闭,严禁使用`start->start->stop`,`start->stop->stop`,`start->start->stop->stop`等类似的顺序调用。 + +**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ------------------------------------------------------------ | +| filename | string | 是 | 用户自定义的profiling文件名,根据传入的`filename`,将在应用的`files`目录生成`filename.json`文件。 | + +**示例:** + +```js +hidebug.startProfiling("cpuprofiler-20220216"); +// code block +// ... +// code block +hidebug.stopProfiling(); +``` + + + +## hidebug.stopProfiling(deprecated) + +stopProfiling() : void + +> **说明:** +> +> 从 API version 9 开始废弃,建议使用[hidebug.stopJsCpuProfiling](#hidebugstopjscpuprofiling9)替代。 + +停止虚拟机Profiling方法跟踪,`stopProfiling()`方法的调用需要与`startProfiling()`方法的调用一一对应,先开启后关闭,严禁使用`start->start->stop`,`start->stop->stop`,`start->start->stop->stop`等类似的顺序调用。 + +**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug + +**示例:** + +```js +hidebug.startProfiling("cpuprofiler-20220216"); +// code block +// ... +// code block +hidebug.stopProfiling(); +``` + +## hidebug.dumpHeapData(deprecated) + +dumpHeapData(filename : string) : void + +> **说明:** +> +> 从 API version 9 开始废弃,建议使用[hidebug.dumpJsHeapData](#hidebugdumpjsheapdata9)替代。 + +虚拟机堆导出。 + +**系统能力:** SystemCapability.HiviewDFX.HiProfiler.HiDebug + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ------------------------------------------------------------ | +| filename | string | 是 | 用户自定义的虚拟机堆文件名,根据传入的`filename`,将在应用的`files`目录生成`filename.heapsnapshot`文件。 | + +**示例:** + +```js +hidebug.dumpHeapData("heap-20220216"); +```