I am running petalinux from sd card. And trying to find data copying rate from Sd card and from QSPI flash that is there on the Xilinx Zynq board.

As suggested here , I am doing like this:

root@Xilinx-ZC702-14_7:/dev# echo 1 > /proc/sys/vm/drop_caches
root@Xilinx-ZC702-14_7:/dev# dd if=/dev/mtd2 of=/dev/null bs=128k count=200
84+0 records in
84+0 records out

But as per the above link it should also print the following lines:

26214400 bytes (25.0MB) copied, 5.971374 seconds, 4.2MB/s

That gives an idea of rate at which flash working.

Why is this line missing in my case? Is there any alterantive to know this rate ?

  • 2
    Haven't used petalinux before, but it looks like the type of distro that would use the BusyBox toolchain, which is really stripped down and might actually not do the progress notification. – Bratchley Mar 7 '14 at 20:31

Showing the throughput rate is a feature of the version of dd from GNU coreutils which is found on non-embedded Linux. PetaLinux uses the BusyBox utility suite, and its dd does not have this feature.

You can use the time utility to measure the total time, and divide the amount of data by that figure. Unfortunately BusyBox's time utility is cumbersome to parse.

time head -c $bytes 2>&1 |
awk -F '[^.0-9]+' -v bytes=$bytes '
    /^sys\t[0-9]*m [0-9.]*s$/ {
        sys_time = $1 * 60 + $2;
    END {printf "Throughput: %f MB/s\n", bytes / 1048576.0 / sys_time}'

I'm not sure hdparm -T / hdparm -t would work correctly on an SD card but it's worth trying.

  • it did not work in my case: root@Xilinx-ZC702-14_7:/dev# hdparm -T -sh: hdparm: not found root@Xilinx-ZC702-14_7:/dev# hdparm -t -sh: hdparm: not found – msz Mar 7 '14 at 9:28
  • Well install it first. It's quite standard, but usually not pre-installed. – orion Mar 7 '14 at 9:33
  • this is not implemented for petalinux. – msz Mar 7 '14 at 9:50
  • Embedded implementations are usually very limited. It's possible that this extra line of verbosity from dd isn't even implemented. gnu versions of core utilities are very extended compared to the bare standard. Do you have time available to directly measure the duration and then calculate it by yourself. – orion Mar 7 '14 at 11:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.