未验证 提交 716846c4 编写于 作者: O openharmony_ci 提交者: Gitee

!4075 【OpenHarmony开源贡献者计划2022】相关格式及表达问题-3

Merge pull request !4075 from king_he/api-c
# HiAppEvent # HiAppEvent
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -23,10 +23,10 @@ Writes event information to the event file of the current day. This API supports ...@@ -23,10 +23,10 @@ Writes event information to the event file of the current day. This API supports
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------------- | ---- | ------------------------------------------------------------ |
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.| | eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter. |
| eventType | [EventType](#eventtype) | Yes | Application event type. | | eventType | [EventType](#eventtype) | Yes | Application event type. |
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.| | keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to process the received return value.<br>-&nbsp; Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>-&nbsp; A value greater than **0** indicates that invalid parameters are present in the event, and the event will be written to the event file asynchronously after the invalid parameters are ignored. <br>-&nbsp; A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file.| | callback | AsyncCallback&lt;void&gt; | No | Callback used to process the received return value.<br>-&nbsp; Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>-&nbsp; A value greater than **0** indicates that invalid parameters are present in the event, and the event will be written to the event file asynchronously after the invalid parameters are ignored. <br>-&nbsp; A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file. |
**Example** **Example**
...@@ -56,15 +56,15 @@ Writes event information to the event file of the current day. This API supports ...@@ -56,15 +56,15 @@ Writes event information to the event file of the current day. This API supports
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ----------------------- | ---- | ------------------------------------------------------------ | | --------- | ----------------------- | ---- | ------------------------------------------------------------ |
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.| | eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter. |
| eventType | [EventType](#eventtype) | Yes | Application event type. | | eventType | [EventType](#eventtype) | Yes | Application event type. |
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.| | keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | ------------------------------------------------------------ | | ------------------- | ------------------------------------------------------------ |
| Promise&lt;void&gt; | Promise used to process the callback in the then() and catch() methods when event writing succeeded or failed.| | Promise&lt;void&gt; | Promise used to process the callback in the then() and catch() methods when event writing succeeded or failed. |
**Example** **Example**
...@@ -92,13 +92,13 @@ Configures the application event logging function, such as setting the event log ...@@ -92,13 +92,13 @@ Configures the application event logging function, such as setting the event log
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | ------------------------ | | ------ | ----------------------------- | ---- | ------------------------ |
| config | [ConfigOption](#configoption) | Yes | Configuration items for application event logging.| | config | [ConfigOption](#configoption) | Yes | Configuration items for application event logging. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------- | ----------------------------------------------------------- | | ------- | ----------------------------------------------------------- |
| boolean | Returns **true** if the configuration is successful; returns **false** otherwise.| | boolean | Returns **true** if the configuration is successful; returns **false** otherwise. |
**Example** **Example**
```js ```js
...@@ -122,8 +122,8 @@ Provides the configuration items for application event logging. ...@@ -122,8 +122,8 @@ Provides the configuration items for application event logging.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------- | ---- | ------------------------------------------------------------ | | ---------- | ------- | ---- | ------------------------------------------------------------ |
| disable | boolean | No | Application event logging switch. The value <b>true</b> means to disable the application event logging function, and the value <b>false</b> means the opposite.| | disable | boolean | No | Application event logging switch. The value <b>true</b> means to disable the application event logging function, and the value <b>false</b> means the opposite. |
| maxStorage | string | No | Maximum size of the event file storage directory. The default value is **10M**. If the specified size is exceeded, the oldest event logging files in the storage directory will be deleted to free up space.| | maxStorage | string | No | Maximum size of the event file storage directory. The default value is **10M**. If the specified size is exceeded, the oldest event logging files in the storage directory will be deleted to free up space. |
## EventType ## EventType
...@@ -150,7 +150,7 @@ Provides constants that define the names of all predefined events. ...@@ -150,7 +150,7 @@ Provides constants that define the names of all predefined events.
| ------------------------- | -------- | ---- | ---- | -------------------- | | ------------------------- | -------- | ---- | ---- | -------------------- |
| USER_LOGIN | string | Yes | No | User login event. | | USER_LOGIN | string | Yes | No | User login event. |
| USER_LOGOUT | string | Yes | No | User logout event. | | USER_LOGOUT | string | Yes | No | User logout event. |
| DISTRIBUTED_SERVICE_START | string | Yes | No | Distributed service startup event.| | DISTRIBUTED_SERVICE_START | string | Yes | No | Distributed service startup event. |
## Param ## Param
...@@ -159,8 +159,8 @@ Provides constants that define the names of all predefined event parameters. ...@@ -159,8 +159,8 @@ Provides constants that define the names of all predefined event parameters.
**System capability**: SystemCapability.HiviewDFX.HiAppEvent **System capability**: SystemCapability.HiviewDFX.HiAppEvent
| Name | Type| Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ------------------------------- | -------- | ---- | ---- | ------------------ | | ------------------------------- | -------- | ---- | ---- | ------------------ |
| USER_ID | string | Yes | No | Custom user ID. | | USER_ID | string | Yes | No | Custom user ID. |
| DISTRIBUTED_SERVICE_NAME | string | Yes | No | Distributed service name. | | DISTRIBUTED_SERVICE_NAME | string | Yes | No | Distributed service name. |
| DISTRIBUTED_SERVICE_INSTANCE_ID | string | Yes | No | Distributed service instance ID.| | DISTRIBUTED_SERVICE_INSTANCE_ID | string | Yes | No | Distributed service instance ID. |
\ No newline at end of file
# HiChecker # HiChecker
> **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -22,7 +22,7 @@ Provides the constants of all rule types. ...@@ -22,7 +22,7 @@ Provides the constants of all rule types.
| RULE\_CAUTION\_PRINT\_LOG | BigInt | Alarm rule, which is programmed to print a log when an alarm is generated. | | RULE\_CAUTION\_PRINT\_LOG | BigInt | Alarm rule, which is programmed to print a log when an alarm is generated. |
| RULE\_CAUTION\_TRIGGER\_CRASH | BigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. | | RULE\_CAUTION\_TRIGGER\_CRASH | BigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. |
| RULE\_THREAD\_CHECK\_SLOW\_PROCESS | BigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. | | RULE\_THREAD\_CHECK\_SLOW\_PROCESS | BigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. |
| RULE\_CHECK\_SLOW\_EVENT | BigInt | Caution rule, which is programmed to detect whether the event distribution or processing time has exceeded the specified time threshold.| | RULE\_CHECK\_SLOW\_EVENT | BigInt | Caution rule, which is programmed to detect whether the event distribution or processing time has exceeded the specified time threshold. |
| RULE\_CHECK\_ABILITY\_CONNECTION\_LEAK| BigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. | | RULE\_CHECK\_ABILITY\_CONNECTION\_LEAK| BigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. |
...@@ -36,9 +36,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac ...@@ -36,9 +36,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be added.| | rule | BigInt | Yes | Rule to be added. |
**Example** **Example**
...@@ -61,9 +61,9 @@ Removes one or more rules. The removed rules will become ineffective. ...@@ -61,9 +61,9 @@ Removes one or more rules. The removed rules will become ineffective.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be removed.| | rule | BigInt | Yes | Rule to be removed. |
**Example** **Example**
...@@ -88,7 +88,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. ...@@ -88,7 +88,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
| Type | Description | | Type | Description |
| ------ | ---------------------- | | ------ | ---------------------- |
| BigInt | Collection of added rules.| | BigInt | Collection of added rules. |
**Example** **Example**
...@@ -110,15 +110,15 @@ Checks whether the specified rule exists in the collection of added rules. If th ...@@ -110,15 +110,15 @@ Checks whether the specified rule exists in the collection of added rules. If th
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be checked.| | rule | BigInt | Yes | Rule to be checked. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------- | ---------------------------------------------------------- | | ------- | ---------------------------------------------------------- |
| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise.| | boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise. |
**Example** **Example**
......
# HiLog # HiLog
> **Note:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -21,12 +20,12 @@ Prints logs of the DEBUG level. ...@@ -21,12 +20,12 @@ Prints logs of the DEBUG level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ | | ------ | -------------- | ---- | ------------------------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. | | tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.| | format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default. |
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.| | args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string. |
**Example** **Example**
...@@ -50,12 +49,12 @@ Prints logs of the INFO level. ...@@ -50,12 +49,12 @@ Prints logs of the INFO level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ | | ------ | -------------- | ---- | ------------------------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. | | tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.| | format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default. |
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.| | args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string. |
**Example** **Example**
...@@ -79,12 +78,12 @@ Prints logs of the WARN level. ...@@ -79,12 +78,12 @@ Prints logs of the WARN level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ | | ------ | -------------- | ---- | ------------------------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. | | tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.| | format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default. |
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.| | args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string. |
**Example** **Example**
...@@ -108,12 +107,12 @@ Prints logs of the ERROR level. ...@@ -108,12 +107,12 @@ Prints logs of the ERROR level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ | | ------ | -------------- | ---- | ------------------------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. | | tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.| | format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default. |
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.| | args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string. |
**Example** **Example**
...@@ -137,12 +136,12 @@ Prints logs of the FATAL level. ...@@ -137,12 +136,12 @@ Prints logs of the FATAL level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ | | ------ | -------------- | ---- | ------------------------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. | | tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.| | format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default. |
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.| | args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string. |
**Example** **Example**
...@@ -166,10 +165,10 @@ Checks whether printing is enabled for a domain, tag, or log level. ...@@ -166,10 +165,10 @@ Checks whether printing is enabled for a domain, tag, or log level.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | --------------------- | ---- | ------------------------------------------ | | ------ | --------------------- | ---- | ------------------------------------------ |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. | | domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior.| | tag | string | Yes | String constant used to identify the class or service behavior. |
| level | [LogLevel](#loglevel) | Yes | Log level. | | level | [LogLevel](#loglevel) | Yes | Log level. |
**Example** **Example**
...@@ -184,10 +183,10 @@ Enumerates event types. ...@@ -184,10 +183,10 @@ Enumerates event types.
**System capability**: SystemCapability.HiviewDFX.HiLog **System capability**: SystemCapability.HiviewDFX.HiLog
| Name | Default Value| Description | | Name | Default Value | Description |
| ----- | ------ | ----------- | | ----- | ------ | ----------- |
| DEBUG | 3 | DEBUG level| | DEBUG | 3 | DEBUG level |
| INFO | 4 | INFO level | | INFO | 4 | INFO level |
| WARN | 5 | WARN level | | WARN | 5 | WARN level |
| ERROR | 6 | ERROR level| | ERROR | 6 | ERROR level |
| FATAL | 7 | FATAL level| | FATAL | 7 | FATAL level |
# Distributed Call Chain Tracing # Distributed Call Chain Tracing
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -16,16 +16,16 @@ Enumerates trace flag types. ...@@ -16,16 +16,16 @@ Enumerates trace flag types.
**System capability**: SystemCapability.HiviewDFX.HiTrace **System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| DEFAULT | 0 | Default flag. | | DEFAULT | 0 | Default flag. |
| INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. | | INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. |
| DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. | | DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. |
| TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. | | TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. |
| NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed.| | NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed. |
| DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. | | DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. |
| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. | | FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. |
| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices.| | D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices. |
## HiTraceTracepointType ## HiTraceTracepointType
...@@ -33,13 +33,13 @@ Enumerates trace point types. ...@@ -33,13 +33,13 @@ Enumerates trace point types.
**System capability**: SystemCapability.HiviewDFX.HiTrace **System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name| Default Value | Description |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| CS | 0 | Client Send (CS) trace point. | | CS | 0 | Client Send (CS) trace point. |
| CR | 1 | Client Receive (CS) trace point. | | CR | 1 | Client Receive (CS) trace point. |
| SS | 2 | Server Send (SS) trace point. | | SS | 2 | Server Send (SS) trace point. |
| SR | 3 | Server Receive (SR) trace point. | | SR | 3 | Server Receive (SR) trace point. |
| GENERAL | 4 | General trace points except CS, CR, SS, and SR.| | GENERAL | 4 | General trace points except CS, CR, SS, and SR. |
## HiTraceCommunicationMode ## HiTraceCommunicationMode
...@@ -47,7 +47,7 @@ Enumerates communication modes. ...@@ -47,7 +47,7 @@ Enumerates communication modes.
**System capability**: SystemCapability.HiviewDFX.HiTrace **System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name| Default Value | Description |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| DEFAULT | 0 | Default communication mode. | | DEFAULT | 0 | Default communication mode. |
| THREAD | 1 | Inter-thread communication. | | THREAD | 1 | Inter-thread communication. |
...@@ -60,12 +60,12 @@ Defines a **HiTraceId** object. ...@@ -60,12 +60,12 @@ Defines a **HiTraceId** object.
**System capability**: SystemCapability.HiviewDFX.HiTrace **System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| chainId | bigint | Yes| Call chain ID. | | chainId | bigint | Yes| Call chain ID. |
| spanId | number | No| Span ID. | | spanId | number | No| Span ID. |
| parentSpanId | number | No| Parent span ID. | | parentSpanId | number | No| Parent span ID. |
| flags | number | No| Trace flag combination.| | flags | number | No| Trace flag combination. |
## hiTraceChain.begin ## hiTraceChain.begin
...@@ -77,16 +77,16 @@ Starts call chain tracing. This API works in synchronous manner. ...@@ -77,16 +77,16 @@ Starts call chain tracing. This API works in synchronous manner.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| name | string | Yes| Traced service name.| | name | string | Yes| Traced service name. |
| flags | number | Yes| Trace flag combination. For details, see [HiTraceFlag](#hitraceflag).| | flags | number | Yes| Trace flag combination. For details, see [HiTraceFlag](#hitraceflag). |
**Return Value** **Return Value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.| | [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example** **Example**
...@@ -104,9 +104,9 @@ Stops call chain tracing. This API works in synchronous manner. ...@@ -104,9 +104,9 @@ Stops call chain tracing. This API works in synchronous manner.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.| | id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Example** **Example**
...@@ -126,9 +126,9 @@ Obtains the trace ID. This API works in synchronous manner. ...@@ -126,9 +126,9 @@ Obtains the trace ID. This API works in synchronous manner.
**Return Value** **Return Value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.| | [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example** **Example**
...@@ -148,9 +148,9 @@ Sets a trace ID. This API works in synchronous manner. ...@@ -148,9 +148,9 @@ Sets a trace ID. This API works in synchronous manner.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.| | id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Example** **Example**
...@@ -186,9 +186,9 @@ Creates a trace span. This API works in synchronous manner. ...@@ -186,9 +186,9 @@ Creates a trace span. This API works in synchronous manner.
**Return Value** **Return Value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.| | [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example** **Example**
...@@ -208,12 +208,12 @@ Triggers a trace point. This API works in synchronous manner. ...@@ -208,12 +208,12 @@ Triggers a trace point. This API works in synchronous manner.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| mode | [HiTraceCommunicationMode](#hitracecommunicationmode) | Yes| Communication mode for the trace point.| | mode | [HiTraceCommunicationMode](#hitracecommunicationmode) | Yes| Communication mode for the trace point. |
| type | [HiTraceTracepointType](#hitracetracepointtype)| Yes| Trace point type.| | type | [HiTraceTracepointType](#hitracetracepointtype)| Yes| Trace point type. |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance for trace point triggering.| | id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance for trace point triggering. |
| msg | string | No| Trace description passed for trace point triggering.| | msg | string | No| Trace description passed for trace point triggering. |
**Example** **Example**
...@@ -233,15 +233,15 @@ Checks whether a **HiTraceId** instance is valid. This API works in synchronous ...@@ -233,15 +233,15 @@ Checks whether a **HiTraceId** instance is valid. This API works in synchronous
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.| | id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Return Value** **Return Value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| boolean | Returns **true** if the **HiTraceId** instance is valid; returns **false** otherwise.| | boolean | Returns **true** if the **HiTraceId** instance is valid; returns **false** otherwise. |
**Example** **Example**
...@@ -260,16 +260,16 @@ Checks whether the specified trace flag in the **HiTraceId** instance is enabled ...@@ -260,16 +260,16 @@ Checks whether the specified trace flag in the **HiTraceId** instance is enabled
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.| | id | [HiTraceId](#hitraceid) | Yes | **HiTraceId** instance. |
| flag | [HiTraceFlag](#hitraceflag) | Yes| Specified trace flag.| | flag | [HiTraceFlag](#hitraceflag) | Yes | Specified trace flag. |
**Return Value** **Return Value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| boolean | Returns **true** if the specified trace flag in the **HiTraceId** instance is enabled; returns **false** otherwise.| | boolean | Returns **true** if the specified trace flag in the **HiTraceId** instance is enabled; returns **false** otherwise. |
**Example** **Example**
...@@ -288,10 +288,10 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i ...@@ -288,10 +288,10 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i
**System capability**: SystemCapability.HiviewDFX.HiTrace **System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.| | id | [HiTraceId](#hitraceid) | Yes | **HiTraceId** instance. |
| flag | [HiTraceFlag](#hitraceflag) | Yes| Specified trace flag.| | flag | [HiTraceFlag](#hitraceflag) | Yes | Specified trace flag. |
**Example** **Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册