未验证 提交 8faf2a8c 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-hidebug.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 f8f15619
......@@ -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<sup>(deprecated)</sup>
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<sup>(deprecated)</sup>
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<sup>(deprecated)</sup>
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.getServiceDump<sup>9+<sup>
getServiceDump(serviceid : number, fd : number, args : Array\<string>) : void
......@@ -251,7 +175,6 @@ getServiceDump(serviceid : number, fd : number, args : Array\<string>) : void
| fd | number | 是 | 文件描述符,该接口会往该fd中写入数据。|
| args | Array\<string> | 是 | 系统服务的Dump接口所对应的参数列表。|
**示例:**
```js
......@@ -359,4 +282,80 @@ try {
console.info(error.code)
console.info(error.message)
}
```
\ No newline at end of file
```
## hidebug.startProfiling<sup>(deprecated)</sup>
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<sup>(deprecated)</sup>
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<sup>(deprecated)</sup>
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");
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册