Introduction to the use of the DDR bandwidth statistics tool on the Rockchip platform

Introduction to the use of the DDR bandwidth statistics tool on the Rockchip platform

Tool introduction

rk-msch-probe-for-user is an official tool for statistics and monitoring system DDR load and bandwidth usage, which can display the current DDR load and bandwidth information in real time.

Support chip platform

Through the rk-msch-probe-for-user-64bit -h command, you can see the chips supported by the current tool, as follows:

rk3588_t_evb7:/ # ./data/rk-msch-probe-for-user-64bit -h
Usage: <-c chip_name> {
    
    {
    
    [-r cs -b bank] [-m master | -i id] [-l log_level]} or [-p top_load -g gap_time_us]} [-t test_loop] [-d msecs] [-f freq] [-h]
-c chip_name:
'rk312x' include rk3126,rk3128 and px3se
'rk322x' include rk3128h,rk3228a,rk3228b and rk3229
'rk3368' include rk3368 and px5
'rk322xh' include rk3228h and rk3328
'rk3326' include px30 and rk3326
'rv1126' include rv1109 and rv1126
'rk3399'
'rk1808'
'rk3288'
'rk3308' include rk3308 and rk3308S
'rv1108'
'rk356x' include rk3566 and rk3568
'rk3588'
'rv1106' and 'rv1103'
'rk3528'

tool acquisition

The rk-msch-probe-for-user tool can be obtained in the Android SDK, and the specific path is as follows:

RKDocs/common/DDR/DDR_bandwidth_statistics_tool/
├── rk-msch-probe-for-user-32bit
├── rk-msch-probe-for-user-64bit
└── Rockchip_Introduction_DDR_Bandwidth_Tool_CN.pdf

Among them: the suffixes 32bit and 64bit refer to systems applicable to 32bit and 64bit.
At present, only the Android13 version of the SDK has this tool, and other SDKs can be obtained through RK's redmine channel

Conditions of use of tools

  1. DDR needs to be used in the fixed frequency mode.
    The fixed frequency mode can be switched by the following command. It is recommended to test at the highest frequency point.
1|rk3588_t_evb7:/ # echo userspace > sys/class/devfreq/dmc/governor

Obtain the frequency point information supported by the system

rk3588_t_evb7:/ # cat sys/class/devfreq/dmc/available_frequencies
528000000 1068000000 1560000000 2112000000

Then fix the DDR frequency, such as DDR fixed frequency to 780MHz:

rk3588_t_evb7:/ # echo 2112000000 > sys/class/devfreq/dmc/userspace/set_freq
  1. The system needs to have a /dev/mem node, that is, the IO command needs to be available.
    If /dev/mem is not found, the following error will be reported when using it:
rk3588_t_evb7:/ # ./data/rk-msch-probe-for-user-64bit -c rk3588
open /dev/mem error: No such file or directory

Solution: Open the CONFIG_DEVMEM macro in the config of the kernel and recompile the kernel to burn it. Note: CONFIG_DEVMEM is enabled by default in the kernel config, but in Android 10 and above, this configuration will be removed in android-xx.config, just remove the corresponding comment.

@sys2_206:~/a2_Android13_29_sdk/mkcombinedroot$ git diff
diff --git a/configs/android-13.config b/configs/android-13.config
index 592931e..1a42959 100644
--- a/configs/android-13.config
+++ b/configs/android-13.config
@@ -2,7 +2,6 @@
 # CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
 # CONFIG_ANDROID_PARANOID_NETWORK is not set
 # CONFIG_BPFILTER is not set
-# CONFIG_DEVMEM is not set
 # CONFIG_FHANDLE is not set
 # CONFIG_FW_CACHE is not set
 # CONFIG_IP6_NF_NAT is not set

Introduction to tool parameters

The DDR bandwidth test tool (rk_msch_probe_vx.xx) supports the following parameter input.

  • -c: Chip name, after confirming that the current platform supports it, just input it according to the platform name, such as rk3588.

  • -d: monitoring interval, in ms, optional. If no parameter is passed, the default is 1000ms.

  • -f: current DDR frequency, in MHz, optional. Every monitoring period, the tool tries to get the DDR frequency. If the acquisition fails, you need to pass in the frequency of the current DDR.

    Note: The DDR frequency needs to be fixed first, otherwise the DDR frequency may change and the measurement result will be inaccurate.

  • -h: help.

Tool print information introduction

Execute rk_msch_probe_vx.xx, it will monitor and print DDR bandwidth and utilization.

The general platform prints as follows:

V1.06_20200629
ddr freq: 928Mhz
CH0:
ddr monitor statistics:
ddr load = 3251.23MB/s(43.76%) [RD:1859.93MB/s(25.03%), WR:1391.30MB/s(18.72%), ACT(access : active): 3.34, srex:0.54%, pdex:1.27%, clkstp:0.00%, lp:1.81%]

The printing of RK3588 has been greatly changed, as follows:

2kijec4hi======================================================================================================
ddr freq: 2112Mhz          cpu      vicap        gpu        vop        isp     others      total
master bw(MB/s)        1035.41       0.00     881.12     494.90       0.00      72.22    2483.65
bw prorated(%)           41.69       0.00      35.48      19.93       0.00       2.91     100.00
utilization(%)            3.06       0.00       2.61       1.46       0.00       0.21       7.35
theoretical bw        33792.00

----------------------------------------------ALL-------------------------CH0-------------------------CH1-------------------------CH2-------------------------CH3--------
               recorded LOAD: max 23465.35MB/s(69.44%), min 3.89MB/s(0.01%), avg 5885.02MB/s(17.42%)
                        LOAD:         2483.65MB/s(7.35%),          694.07MB/s(8.22%),          550.30MB/s(6.51%),          688.31MB/s(8.15%),          550.97MB/s(6.52%)
                          RD:         1620.78MB/s(4.80%),          451.92MB/s(5.35%),          361.63MB/s(4.28%),          446.05MB/s(5.28%),          361.18MB/s(4.28%)
                          WR:          862.87MB/s(2.55%),          242.15MB/s(2.87%),          188.67MB/s(2.23%),          242.26MB/s(2.87%),          189.79MB/s(2.25%)
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Statistical result description:

Print explain
ALL Total bandwidth statistics for all channels
CHx DDR channel x bandwidth statistics
load/LOAD For all DDR banks, the bandwidth and load of this channel
RD For all DDR banks, the bandwidth and proportion of DDR read data
WR For all DDR banks, the bandwidth and proportion of DDR write data
PRE For all DDR banks, command precharge as a percentage of the total number of commands. Precharge and active appear in pairs, and there is no actual hardware statistics, but the statistical results of the active command are directly used
ACT(access : active) For all DDR banks, there are several read/writes after each DDR active command on average. The larger the value, the more continuous the access to the DDR address. The larger the better
srex The percentage of time that the DDR is in the self-refresh state
pdex The percentage of time that DDR is in power down state
clkstp The proportion of time that DDR is in the clock stop state
srpdex The percentage of time that DDR is in self-refresh power down state
dsmex The proportion of time that DDR is in Deep Sleep Mode state
lp/ LOW POWER DDR time ratio in low power state (low power state includes self-refresh, power down and clock stop, etc.)

RK3588 chip usage example

Steps for usage:

  1. Push the rk-msch-probe-for-user-64bit tool to the machine, and modify the permission to 777
$ adb push ~/206_samba/a2_Android13_29_sdk/RKDocs/common/DDR/DDR_bandwidth_statistics_tool/rk-msch-probe-for-user-64bit data/
$ adb shell chmod 777 ./data/rk-msch-probe-for-user-64bit
  1. Confirm whether the **/dev/mem** node exists
130|rk3588_t_evb7:/ # ls /dev/mem
/dev/mem
  1. Set the DDR fixed frequency at the highest frequency 2112MHz
1|rk3588_t_evb7:/ # echo userspace > sys/class/devfreq/dmc/governor
rk3588_t_evb7:/ # cat sys/class/devfreq/dmc/available_frequencies
528000000 1068000000 1560000000 2112000000
rk3588_t_evb7:/ # echo 2112000000 > sys/class/devfreq/dmc/userspace/set_freq
  1. start operation
1|rk3588_t_evb7:/ # ./data/rk-msch-probe-for-user-64bit -c rk3588
V1.30_20221206

2kijec4hi======================================================================================================
ddr freq: 2112Mhz          cpu      vicap        gpu        vop        isp     others      total
master bw(MB/s)           3.49       0.00       0.00       0.00       0.00       0.40       3.89
bw prorated(%)           89.78       0.00       0.00       0.00       0.00      10.22     100.00
utilization(%)            0.01       0.00       0.00       0.00       0.00       0.00       0.01
theoretical bw        33792.00

----------------------------------------------ALL-------------------------CH0-------------------------CH1-------------------------CH2-------------------------CH3--------
               recorded LOAD: max 3.89MB/s(0.01%), min 3.89MB/s(0.01%), avg 3.89MB/s(0.01%)
                        LOAD:            3.89MB/s(0.01%),            1.73MB/s(0.02%),            0.55MB/s(0.01%),            1.05MB/s(0.01%),            0.55MB/s(0.01%)
                          RD:            2.87MB/s(0.01%),            1.45MB/s(0.02%),            0.32MB/s(0.00%),            0.78MB/s(0.01%),            0.32MB/s(0.00%)
                          WR:            1.02MB/s(0.00%),            0.28MB/s(0.00%),            0.23MB/s(0.00%),            0.28MB/s(0.00%),            0.23MB/s(0.00%)
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1. Run applications that need to monitor ddr information on the device

Guess you like

Origin blog.csdn.net/weixin_43245753/article/details/128262895