- Last edited 4 months ago ago
How to measure the DDR throughput
1 Article purpose
This article explains how to measure the overall DDR throughput generated during a Linux® user space command execution.
2 Measurement flow
The DDR throughput measurement is done via counters provided by the DDRPERFM internal peripheral and controlled by stm32_ddr_pmu performance monitoring unit driver that is registered to the Linux kernel perf framework.
From user land side, the perf tool is used to interact with the perf framework in order to record given events (such as stm32_ddr_pmu) during a command execution.
Once recorded, the stm32_ddr_pmu.py Python script is used to compute the corresponding DDR throughputs.
Launching this script without any parameter returns the usage information:
Board $> python3 /usr/bin/stm32_ddr_pmu.py Usage: python stm32_ddr_pmu.py [-d <ddr_freq>] -f <perf_file> -d ddr_freq: DDR frequency in MHz (533 MHz by default) -f perf_file: text file containing the output of perf stat -e stm32_ddr_pmu/read_cnt/,stm32_ddr_pmu/time_cnt/,stm32_ddr_pmu/write_cnt/ -a -o <perf_file> <command>
Let us see how to measure the DDR throughput generated during the 'sleep 1' command execution.
First, record the counters into 'perf.txt' file, providing the command to launch as parameter:
Board $> perf stat -e stm32_ddr_pmu/read_cnt/,stm32_ddr_pmu/time_cnt/,stm32_ddr_pmu/write_cnt/ -a -o perf.txt sleep 1
Then, run the Python script to convert the result in throughput values:
Board $> python3 /usr/bin/stm32_ddr_pmu.py -f perf.txt R = 8 MB/s, W = 2 MB/s, R&W = 9 MB/s (DDR @ 533 MHz)
These low figures are due to the fact that the measurement was done with Weston stopped.