Collection Command collect
Command Function
The tool enables one-click collection of multidimensional performance statistics, covering cache misses, memory access, NUMA, microarchitecture, miss latencies, hotspot functions, CPU usage, NIC bandwidth, I/O, memory usage, softirqs, PCIe, PA2Ring, and Ring2PA.
Syntax
1 | ./ksys collect [-h] [-o OUTPUT] [-d <sec>] [-i <sec>] [-p PID] [-c CONFIG] [-l {0,1,2,3}] ... |
Parameter Description
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. This parameter is optional. |
-o/--output |
- |
JSON file directory. This parameter is optional. If you do not set this parameter, a JSON file in the Y_M_D_H_M_S_report format is generated in the current directory. |
-d/--duration |
- |
Collection duration, in seconds. The minimum value is 1 second and the default value is 30 seconds. This parameter is optional. |
-i/--interval |
- |
Collection interval, in seconds. The minimum value and default value are both 1 second. This parameter is optional. NOTE:
It is recommended that the collection interval specified by the -i parameter be less than or equal to one tenth of the collection duration specified by the -d parameter. Otherwise, an alarm is generated. For example, if the collection duration is 10 seconds, the collection interval should not exceed 1 second. |
-p/--pid |
- |
ID of the collected process. This parameter is optional. If you do not set this parameter, the tool collects system-wide data. |
-c/--config |
- |
Path to the YAML configuration file. This parameter is optional. In this file, you can customize the parameters (such as whether to collect data and the collection frequency) of hotspot function collection and the SPE collection module. For details about the format requirements, see the config.yaml file in the tool installation directory. |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
Example
Display the information about collect:
1 | ./ksys collect -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 | USAGE ksys collect [-h] [-o OUTPUT] [-d <sec>] [-i <sec>] [-p PID] [-c CONFIG] [-l {0,1,2,3}] ... DESCRIPTION Create a collection command line task. POSITIONAL ARGUMENTS workload Specify workload parameters: contains the application and application parameters. options: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT Output the full path. -d <sec>, --duration <sec> Duration in seconds for the task collect. The minimum value is 1, and the default value is 30. The user can use Ctrl+ \ to cancel the task or Ctrl+ C to stop the task collection and enter the analysis. -i <sec>, --interval <sec> Interval in seconds for sampling. The minimum value is 1, and the default value is 1. The maximum value is 10 and cannot exceed the collection duration. It is advisable to set the interval to no more than one-tenth of the total collection duration. The time for collecting hotspot data in each subreport depends on the interval parameter. -p PID, --pid PID Analyze existing process. When pid does not exist, the collection will stop halfway. When this option is enabled, the hotspot collection can provide support for on-cpu/off-cpu check. -c CONFIG, --config CONFIG Input the path of the config yaml file. The file format must be consistent with the sample. -l {0,1,2,3}, --log-level {0,1,2,3} Set the log level (0=DEBUG, 1=INFO, 2=WARNING, 3=ERROR), which defaults to 1(INFO). |
Metric Description
- PCIe
Table 2 PCIe metrics Metric
Description
rx_rd_bw
RX read bandwidth, which is CPU-to-device bandwidth. Tests show that this bandwidth is proportional to CPU write bandwidth. For example, 1 MB/s RX read bandwidth may correspond to 30 MB/s CPU write bandwidth.
rx_wr_bw
RX write bandwidth, which is device-to-CPU bandwidth. Tests show that this bandwidth is the same as CPU read bandwidth.
- Protocol adapter (PA)
Table 3 PA metrics Metric
Description
PA2Ring_bw
Bandwidth for data transmission from the PA to the ring.
Ring2PA_bw
Bandwidth for data transmission from the ring to the PA.