龙芯2K1000下的memtester及stressapptest的交叉编译运行测试
最近新设计的龙芯2K1000-DDR4_SODIMM核心板(LoongRing Pai)模块进入压力测试阶段!
主要搭载硬件模块简介:
①处理器龙芯2K1000 1GHz双核,无缝支持2K1000LA版本;
②内存4GB DDR3(时钟频率@400-450MHz);
③双路RTL8211E GMAC PHY网卡 ;
④板载硬件WDT看门狗芯片可配置使用/禁用;
⑤板载一颗SPI FLASH可以作为启动PMON或者挂载到SPI0 CS3使用。
有了硬件,龙芯官方PMON(下载地址:http://ftp.loongnix.cn/loongsonpi/pi_2/source/)也正常跑起,为了方便测试直接采用了vmlinuz+内嵌ramdisk模式启动到文件系统,至此就需要一些专门的测试软件开展稳定性和性能压力测试,确保各位龙粉能稳定的折腾龙芯2K1000哦,于是脑袋里第一反应就是UnixBench、memtester、stressapptest等常规开源测试程序。
--->下面进入正题:首先去下载相关测试程序源码①memtester下载地址 https://pyropus.ca./software/memtester/old-versions/memtester-4.6.0.tar.gz ②stressapptest下载地址 https://gitcode.net/mirrors/stressapptest/stressapptest/-/archive/master/stressapptest-master.tar.gz ,然后就到ubuntu虚拟机里面进行交叉编译,下面要说明的就是编译注意点:
1)在交叉编译龙芯64位处理器下的【memtester】时候需要手动修改2个源文件:conf-cc、conf-ld,具体分布修改为:
【1修改conf-cc为如下】
mips64el-linux-gcc -O2 -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 -DTEST_NARROW_WRITES -c
This will be used to compile .c files.
If you use GCC 12, it emits a warning for something which is correct code.
The warning message looks like an error:
memtester.c:142:9: error: suggest parentheses around assignment used as
truth value [-Werror=parentheses]
You can ignore the warning message; the code is correct. If the warning message
bothers you, you can add `-Wno-parentheses` to the options above.
【2修改conf-ld为如下】
mips64el-linux-gcc -s
This will be used to link .o files into an executable.
2)保存后,在顶层目录执行make即可生成memtester可执行程序,如下图:
(需要注意的是交叉编译工具需要提前安装,下载地址:http://ftp.loongnix.cn/loongsonpi/pi_2/toolchain/gcc-4.9.3-64-gnu%20.tar.gz)
3)然后拷贝到开发板文件系统运行就可以了,具体使用方法很简单,运行 # ./memtester 1024 3,表示1024M内存测试3次,运行过程如下:
4)接下来编译测试【stressapptest】,同样先去下载源码:https://gitcode.net/mirrors/stressapptest/stressapptest/-/archive/master/stressapptest-master.tar.gz
解压后进入顶层目录即可,先开始配置,为了方便在ramdisk文件系统的运行,需要编译为可执行程序+静态库这样就直接运行了不依赖外部库文件:
# CC="mips64el-linux-gcc" ./configure --host=mips64el-linux- --with-static
# make
编译完成后可执行程序在【 stressapptest-master/src 】目录下哦!!!
然后开始运行测试,具体的使用参数可以自行搜索,这款工具还是不错的
参考测试命令:stressapptest -s 600 -M 1024 -m 2 -C 8 -W
参数说明:
-s: number of second to run the application 测试时间
-m: number of memory copy threads to run 复制线程数 (Memory Copy)
-i: number of memory invert threads to run 反转线程数 (Invert Copy)
-c: CRC check CRC校验 (Data Check)
-C: number of memory CPU stress threads to run CPU压力线程数
-M: Megabytes of ram to run 尽可能测试最大的可用内存空间
-W: Use more CPU-stressful memory copy
可以查看其他所有参数 # ./stressapptest -h
运行截图如下:
2K1000疯狂压力测试中~~~~~~~~
==========================END==========================