鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

collect采集命令

命令功能

支持采集多维度性能数据,包括Miss、访存统计、NUMA、微架构、Miss Latency、热点函数、CPU usage、NIC bandwidth、I/O、Memory usage、Softirq、PCIe、PA2Ring、Ring2PA数据性能数据。

命令格式

1
ksys collect [-h] [-o OUTPUT] [-d <sec>] [-i <sec>] [-p PID] [-c CONFIG] [-l {0,1,2,3}] ...

参数说明

表1 参数说明

参数

参数选项

参数说明

-h/--help

-

可选参数,获取帮助信息。

-o/--output

-

可选参数,指定生成JSON文件的目录,不指定则在当前目录下生成格式为“Y_M_D_H_M_S_report”的JSON文件。

-d/--duration

-

可选参数,指定采集时间(以秒为单位),最小值为1秒,默认值为10秒。

-i/--interval

-

可选参数,指定采样间隔(以秒为单位),最小值为0.1秒,默认值为1秒。

说明:

建议-i参数指定的采样间隔不超过-d指定的采集时间的十分之一,否则会有警告。

例如:采样时间为10秒,采集间隔不超过1秒。

-p/--pid

-

可选参数,指定采集进程,不指定则对系统进行采集。

-c/--config

-

可选参数,指定.yaml配置文件路径。通过指定该文件可自定义热点函数采集、SPE采集模块的运行参数(如是否采集、采集频率等)。格式要求可参考工具安装目录下的config.yaml文件。

-l/--log-level

0/1/2/3

可选参数,设置日志级别,默认为1。

  • 0:日志级别为DEBUG。
  • 1:日志级别为INFO。
  • 2:日志级别为WARNING。
  • 3:日志级别为ERROR。

使用示例

执行以下命令,查看collect命令支持的功能信息:

1
ksys collect -h

返回信息如下:

 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).

指标说明

  • PCIe
    表2 PCIe指标

    指标

    说明

    rx_rd_bw(RX读带宽)

    指CPU到设备(CPU-to-Device)的带宽,对应从CPU端来看表现为写入带宽。实际测试中与CPU端写操作带宽存在比例关系。(如1MB/s的RX读带宽可能对应30MB/s的CPU写带宽)。

    rx_wr_bw(RX写带宽)

    指设备到CPU(Device-to-CPU)的带宽,对应从CPU端来看表现为读取带宽。实际测试中与CPU端读带宽一致。

  • PA(协议适配器)
    表3 PA指标

    指标

    说明

    PA2Ring_bw(PA到Ring带宽)

    从PA到Ring的数据传输带宽。

    Ring2PA_bw(Ring到PA带宽)

    从Ring到PA的数据传输带宽。