linux下 DDR,SD卡速度测试

一、内存(DDR)测试

主要是捕获内存错误和一直处于很高或者很低的坏位, 其测试的主要项目有随
机值,异或比较,减法,乘法,除法,与或运算等等。

测试工具memtester
格式:memtester 内存数量 次数

root@ATK-IMX6U:~# memtester 8M 1
memtester version 4.3.0 (32-bit)
Copyright (C) 2001-2012 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffff000
want 8MB (8388608 bytes)
got  8MB (8388608 bytes), trying mlock ...locked.
Loop 1/1:
  Stuck Address       : ok
  Random Value        : ok
  Compare XOR         : ok
  Compare SUB         : ok
  Compare MUL         : ok
  Compare DIV         : ok
  Compare OR          : ok
  Compare AND         : ok
  Sequential Increment: ok
  Solid Bits          : ok
  Block Sequential    : ok
  Checkerboard        : ok
  Bit Spread          : ok
  Bit Flip            : ok
  Walking Ones        : ok
  Walking Zeroes      : ok

Done.

二、TF卡测试

time 命令常用于测量一个命令的运行时间,dd 用于复制,从 if(input file)文件读出,写到of(output file)指定的文件,bs 是每次写块的大小,count 是读写块的数量。"if=/dev/zero"不产生IO,即可以不断输出数据,因此可以用来测试纯写速度。

写速度

root@ATK-IMX6U:/# time dd if=/dev/zero of=/run/media/mmcblk0p1/test bs=1024k count=50 conv=fdatasync
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 4.79732 s, 10.9 MB/s

real    0m4.822s
user    0m0.030s
sys     0m0.810s

这里一共写入 50 MiB test 文件,速度为 10.9MB/s

执行下面指令清除缓存

echo 3 > /proc/sys/vm/drop_caches

读速度

root@ATK-IMX6U:/# time dd if=/run/media/mmcblk0p1/test of=/dev/null bs=1024k
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 2.86351 s, 18.3 MB/s

real    0m2.927s
user    0m0.020s
sys     0m0.260s

这里一共读取 50 MiB test 文件,速度为 18.3MB/s

猜你喜欢

转载自blog.csdn.net/WANGYONGZIXUE/article/details/117604337