Rate This Document
Findability
Accuracy
Completeness
Readability

Collecting Data in Attach Mode

The Link Latency Detection tool can collect data in Attach mode during runtime.

Command Function

Collects data in Attach mode. After you start an application and specify its PID, the tool collects the application running data.

  • The Attach mode is available only on the Kunpeng platform.
  • In Attach mode, the tool collects data during application runtime and does not require the application to be restarted.

Syntax

1
devkit advisor knet [-h | --help] {attach} {-p PROCESS_ID} {-i CONF_FILE_PATH} {-o OUTPUT_DIR_PATH} [-l {0,1,2,3} | --log-level {0,1,2,3}] [--set-timeout TIMEOUT]

Parameter Description

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-p

-

Application PID. This parameter is mandatory.

-i

-

Configuration file, which specifies the path to the configuration file of the functions to be recorded. This parameter is mandatory. For details about the configuration file format, see Configuration File Description.

-o

-

Data file output directory. This parameter is mandatory. For details about the data file format, see Storage of Collected Data Files.

-l/--log-level

0/1/2/3

Log level, which defaults to 1. This parameter is optional.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

--set-timeout

-

Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. This parameter is optional. By default, there is no timeout interval. The task will be executed until it is complete.

Example

View the Link Latency Detection functions in Attach mode:

1
devkit advisor knet attach -h

Command output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
OVERVIEW
    Run this command with 'knet' to attach the collector(librecord.so) to a running process

USAGE
    devkit advisor knet [-h | --help] {attach} {-p PROCESS_ID} {-i CONF_FILE_PATH} {-o OUTPUT_DIR_PATH}
    [-l {0,1,2,3} | --log-level {0,1,2,3}]
    [--set-timeout TIMEOUT]

OPTIONS
    -h, --help
    Get help information and exit.

    attach
    [Mandatory option] Specify using the attach feature.

    -p PROCESS_ID
    [Mandatory option] Specify the running process id to attach.

    -i CONF_FILE_PATH
    [Mandatory option] Specify the path to the configuration file which contains function names to be collected.

    -o OUTPUT_DIR_PATH
    [Mandatory option] Specify the directory where collected data files will be saved.

    -l, --log-level {0,1,2,3}
    Specify the log level of the current task, 0(DEBUG) | 1(INFO) | 2(WARNING) | 3(ERROR). The default value is 1(INFO).

    --set-timeout <min>
    Specify the timeout period of a task. By default, the timeout period is not set.

EXAMPLE
    devkit advisor knet attach -p <pid> -i /path/to/conf -o /path/to/data_dir