基于CPU访问缓存和内存的PMU事件,分析存储的访问次数、命中率、带宽等相关情况。
devkit tuner memory [-h] [-d <sec>] [-l {0, 1, 2, 3}] [-i <sec>] [-o] [-m {1, 2, 3, 4}] [-P {100, 1000}] [-c {n,m | n-m}] [--package]
参数 |
参数选项 |
说明 |
---|---|---|
-h/--help |
- |
获取帮助信息。 |
-d/--duration |
- |
设置采集时长,单位为秒,最小值为1秒,默认一直采集,可使用Ctrl+\取消任务或Ctrl+C停止采集并进入分析。 |
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
-i/--interval |
- |
设置任务的采集间隔(以秒为单位)。最小值为1秒,最大值不能超过采集时长,默认为采集时长。如果不指定间隔,不生成子报告。每个子报告中收集数据的时间取决于间隔参数。 |
-m/--metric |
1/2/3/4 |
设置采样类型,默认为1。
|
-o/--output |
- |
设置报告数据压缩包名称和输出路径,仅输入名称时默认生成在当前所在目录;需和--package配合使用。 |
-c/--cpu |
- |
指定采集的CPU核数,如“0”、“0,1,2”、“0-2”。默认采集所有CPU核。 |
-P/--period |
100/1000 |
设置实际数据采集的间隔。默认为1000毫秒,可选100毫秒和1000毫秒;若采集时长选择1秒,采集间隔的默认值将自动调整为100毫秒。 |
--package |
- |
设置是否在生成报告数据压缩包,不指定压缩包名称和路径时默认在当前所在目录生成memory-时间戳.tar。 |
devkit tuner memory -d 2 -o /home/memory_result -m 1 --package
返回信息如下:
Memory Summary Report-ALL Time:2024/07/22 15:30:16 ================================================================================ System Information ──────────────────────────────────────────────────────────────────── Linux Kernel Version 4.19.25-203.el7.bclinux.aarch64 Cpu Type 920 NUMA NODE 0 1 2 3 cpus 0-31 32-63 64-95 96-127 Percentage of core Cache miss ──────────────────────────────────────────────────────────────────── L1D 3.47% L1I 0.01% L2D 58.88% L2I 35.26% DDR Bandwidth ──────────────────────────────────────────────────────────────────── ddrc_write 658.03MB/s ddrc_read 16900.26MB/s Memory metrics of the Cache ──────────────────────────────────────────────────────────────────── 1. L1/L2/TLB Access Bandwidth and Hit Rate Value Format: X|Y = Bandwidth | Hit Rate ───────────────────────────────────────────────────────────────────── CPU L1D L1I L2D L2I L2D_TLB L2I_TLB ──────────────────────────────────────────────────────────────────── all 81581.38MB/s|96.53% 201888.73MB/s|99.99% 35588.65MB/s|41.12% 72.89MB/s|64.74% N/A|57.10% N/A|94.37% ──────────────────────────────────────────────────────────────────── 2. L3 Read Bandwidth and Hit Rate ───────────────────────────────────────────────────────────────── NODE Read Hit Bandwidth Read Bandwidth Read Hit Rate ───────────────────────────────────────────────────────────────── 0 369.95MB/s 21079.22MB/s 1.76% 1 10.93MB/s 181.49MB/s 6.02% 2 23.75MB/s 296.73MB/s 8.00% 3 4.17MB/s 110.28MB/s 3.78% ───────────────────────────────────────────────────────────────── Memory metrics of the DDRC ──────────────────────────────────────────────────────────────────── 1. DDRC_ACCESS_BANDWIDTH Value Format: X|Y = DDR read | DDR write DDRC Read Bandwidth Bottleneck: 12500MB/s (for reference only) Exceeding the bottleneck will significantly increase latency. Please refer to README_ZH.md(Chapter 6.7) for specific bottleneck testing configurations. DDRC exceeding bottleneck: [Node 0, DDRC_2, DDR READ] ──────────────────────────────────────────────────────────────────── NODE DDRC_0 DDRC_1 DDRC_2 DDRC_3 Total ──────────────────────────────────────────────────────────────────── 0 0.00MB/s|0.00MB/s 0.00MB/s|0.00MB/s 16779.55MB/s|616.21MB/s 0.00MB/s|0.00MB/s 16779.55MB/s|616.21MB/s 1 0.00MB/s|0.00MB/s 0.00MB/s|0.00MB/s 0.00MB/s| 0.00MB/s 7.55MB/s|5.24MB/s 7.55MB/s| 5.24MB/s 2 0.00MB/s|0.00MB/s 0.00MB/s|0.00MB/s 85.35MB/s| 27.01MB/s 0.00MB/s|0.00MB/s 85.35MB/s| 27.01MB/s 3 0.00MB/s|0.00MB/s 0.00MB/s|0.00MB/s 0.00MB/s| 0.00MB/s 27.80MB/s|9.56MB/s 27.80MB/s| 9.56MB/s ──────────────────────────────────────────────────────────────────── 2. DDRC_ACCESS_COUNT Value Format: X|Y = read | write ──────────────────────────────────────────────────────────────────── NODE Local Cross-die Cross-chip Total ──────────────────────────────────────────────────────────────────── 0 224,028,776/s|82,073/s 13,152/s| 2,718/s 14,429/s|1,354/s 224,056,357/s|86,145/s 1 29,818/s| 8,037/s 425,625/s|31,801/s 1,251/s| 42/s 456,694/s|39,880/s 2 98,294/s|67,183/s 36,947/s| 3,866/s 80,361/s|3,736/s 215,602/s|74,785/s 3 27,842/s| 6,676/s 172/s| 74/s 17,163/s|3,310/s 45,177/s|10,060/s ──────────────────────────────────────────────────────────────────── The report /home/memory_result.tar is generated successfully. To view summary report. you can run: devkit report -i /home/memory_result.tar To view detail report. you can import the report to the WebUI or IDE to view details.
输出报告说明:
报告由七个部分组成,自上而下分别为系统信息、L1/L2缓存平均未命中率信息、总DDR带宽信息、L1/L2缓存带宽和命中率信息、L3缓存读带宽和命中率信息、DDRC带宽信息和DDRC访问次数信息。
如果用户通过-c指定了采集的CPU核,会显示每个CPU核的L1/L2缓存带宽和CPU命中率信息。如果用户未指定-c则默认采集所有CPU核的平均L1/L2缓存带宽和命中率信息。
显示所有DDR控制器(DDRC)的读写带宽,通常每个NUMA节点会有4个DDRC。
显示各节点的本地、跨DIE、跨Chip和总DDRC访问次数。该信息受-c参数影响,如设置-c为0则只统计该CPU核的DDRC访问次数信息。