CPU性能测试工具coremark使用
CoreMark
是由EEMBC(Embedded Microprocessor Benchmark Consortium)
的Shay Gla-On
于2009
年提出的一项基准测试程序,CoreMark
的主要目标是简化操作,并提供一套测试多核处理器核心的方法。测试标准是在配置参数的组合下单位时间内运行的CoreMark
程序次数(单位:CoreMark/MHz
),该数字值越大则说明测试的性能越好。
操作步骤如下:
一、获取源码
[root@ecs ~]# git clone https://github.com/eembc/coremark.git
或者直接下载zip格式皆可,本次测试用的是zip格式
二、解压查看目录结构
[root@ecs coremark-main]# tree
.
├── barebones
│ ├── core_portme.c
│ ├── core_portme.h
│ ├── core_portme.mak
│ ├── cvt.c
│ └── ee_printf.c
├── core_list_join.c
├── core_main.c
├── coremark.h
├── coremark.md5
├── core_matrix.c
├── core_state.c
├── core_util.c
├── cygwin #### --x86 cygwin和gcc的测试代码
│ └── core_portme.mak
├── docs
│ ├── balance_O0_joined.png
│ ├── coremark_profile_o0_joined.png
│ ├── html
│ │ ├── files
│ │ │ ├── core_list_join-c.html
│ │ │ ├── core_main-c.html
│ │ │ ├── coremark-h.html
│ │ │ ├── core_matrix-c.html
│ │ │ ├── core_state-c.html
│ │ │ ├── core_util-c.html
│ │ │ ├── docs
│ │ │ │ └── core_state.png
│ │ │ ├── linux
│ │ │ │ ├── core_portme-c.html
│ │ │ │ ├── core_portme-h.html
│ │ │ │ └── core_portme-mak.html
│ │ │ ├── PIC32
│ │ │ │ └── core_portme-mak.html
│ │ │ ├── readme-txt.html
│ │ │ └── release_notes-txt.html
│ │ ├── index
│ │ │ ├── BuildTargets.html
│ │ │ ├── Configuration.html
│ │ │ ├── Configurations.html
│ │ │ ├── Files.html
│ │ │ ├── Functions.html
│ │ │ ├── General2.html
│ │ │ ├── General.html
│ │ │ ├── Types.html
│ │ │ └── Variables.html
│ │ ├── index.html
│ │ ├── javascript
│ │ │ ├── main.js
│ │ │ └── searchdata.js
│ │ ├── search
│ │ │ ├── BuildTargetsP.html
│ │ │ ├── ConfigurationC.html
│ │ │ ├── ConfigurationH.html
│ │ │ ├── ConfigurationM.html
│ │ │ ├── ConfigurationsH.html
│ │ │ ├── ConfigurationS.html
│ │ │ ├── ConfigurationsM.html
│ │ │ ├── ConfigurationsS.html
│ │ │ ├── ConfigurationsT.html
│ │ │ ├── ConfigurationT.html
│ │ │ ├── ConfigurationU.html
│ │ │ ├── FilesC.html
│ │ │ ├── FilesR.html
│ │ │ ├── FunctionsC.html
│ │ │ ├── FunctionsG.html
│ │ │ ├── FunctionsI.html
│ │ │ ├── FunctionsM.html
│ │ │ ├── FunctionsP.html
│ │ │ ├── FunctionsS.html
│ │ │ ├── FunctionsT.html
│ │ │ ├── GeneralB.html
│ │ │ ├── GeneralC.html
│ │ │ ├── GeneralD.html
│ │ │ ├── GeneralF.html
│ │ │ ├── GeneralG.html
│ │ │ ├── GeneralH.html
│ │ │ ├── GeneralI.html
│ │ │ ├── GeneralL.html
│ │ │ ├── GeneralM.html
│ │ │ ├── GeneralO.html
│ │ │ ├── GeneralP.html
│ │ │ ├── GeneralR.html
│ │ │ ├── GeneralS.html
│ │ │ ├── GeneralT.html
│ │ │ ├── GeneralU.html
│ │ │ ├── GeneralV.html
│ │ │ ├── GeneralW.html
│ │ │ ├── NoResults.html
│ │ │ ├── TypesS.html
│ │ │ ├── VariablesC.html
│ │ │ ├── VariablesD.html
│ │ │ ├── VariablesL.html
│ │ │ ├── VariablesO.html
│ │ │ ├── VariablesP.html
│ │ │ ├── VariablesR.html
│ │ │ └── VariablesS.html
│ │ └── styles
│ │ ├── 1.css
│ │ ├── 2.css
│ │ └── main.css
│ └── READM.md
├── freebsd
│ └── core_portme.mak
├── LICENSE.md
├── linux
│ └── core_portme.mak
├── macos
│ └── core_portme.mak
├── Makefile
├── posix
│ ├── core_portme.c
│ ├── core_portme.h
│ ├── core_portme.mak
│ └── core_portme_posix_overrides.h
├── README.md
├── rtems
│ ├── core_portme.mak
│ └── init.c
└── simple├── core_portme.c├── core_portme.h└── core_portme.mak18 directories, 105 files
[root@ecs coremark-main]#
三、编译生成coremark.exe文件
可以直接执行make 命令,默认为单线层
如果要使用多线程,可以使用如下命令:
make XCFLAGS='-g -DMULTITHREAD=N -DUSE_FORK=1' ##N为要执行的线程数如下:
[root@ecs coremark-main]# make XCFLAGS='-g -DMULTITHREAD=1 -DUSE_FORK=1'
make XCFLAGS="-g -DMULTITHREAD=1 -DUSE_FORK=1 -DPERFORMANCE_RUN=1" load run1.log
make[1]: Entering directory `/root/coremark-main'
make port_prebuild
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_prebuild'.
make[2]: Leaving directory `/root/coremark-main'
make link
make[2]: Entering directory `/root/coremark-main'
cc -O2 -Ilinux -Iposix -I. -DFLAGS_STR=\""-O2 -g -DMULTITHREAD=1 -DUSE_FORK=1 -DPERFORMANCE_RUN=1 -lrt"\" -DITERATIONS=0 -g -DMULTITHREAD=1 -DUSE_FORK=1 -DPERFORMANCE_RUN=1 core_list_join.c core_main.c core_matrix.c core_state.c core_util.c posix/core_portme.c -o ./coremark.exe -lrt
Link performed along with compile
make[2]: Leaving directory `/root/coremark-main'
make port_postbuild
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_postbuild'.
make[2]: Leaving directory `/root/coremark-main'
make port_preload
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_preload'.
make[2]: Leaving directory `/root/coremark-main'
echo Loading done ./coremark.exe
Loading done ./coremark.exe
make port_postload
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_postload'.
make[2]: Leaving directory `/root/coremark-main'
make port_prerun
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_prerun'.
make[2]: Leaving directory `/root/coremark-main'
./coremark.exe 0x0 0x0 0x66 0 7 1 2000 > ./run1.log
make port_postrun
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_postrun'.
make[2]: Leaving directory `/root/coremark-main'
make[1]: Leaving directory `/root/coremark-main'
make XCFLAGS="-g -DMULTITHREAD=1 -DUSE_FORK=1 -DVALIDATION_RUN=1" load run2.log
make[1]: Entering directory `/root/coremark-main'
make port_preload
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_preload'.
make[2]: Leaving directory `/root/coremark-main'
echo Loading done ./coremark.exe
Loading done ./coremark.exe
make port_postload
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_postload'.
make[2]: Leaving directory `/root/coremark-main'
make port_prerun
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_prerun'.
make[2]: Leaving directory `/root/coremark-main'
./coremark.exe 0x3415 0x3415 0x66 0 7 1 2000 > ./run2.log
make port_postrun
make[2]: Entering directory `/root/coremark-main'
make[2]: Nothing to be done for `port_postrun'.
make[2]: Leaving directory `/root/coremark-main'
make[1]: Leaving directory `/root/coremark-main'
Check run1.log and run2.log for results.
See README.md for run and reporting rules.
[root@ecs coremark-main]#
四、查看结果
执行完上述命令之后,该目录下会生成coremark.exe run1.log run2.logw文件:
[root@ecs coremark-main]# ll
total 240
drwxr-xr-x 2 root root 4096 Nov 18 02:50 barebones
-rw-r--r-- 1 root root 18219 Nov 18 02:50 core_list_join.c
-rw-r--r-- 1 root root 15788 Nov 18 02:50 core_main.c
-rwxr-xr-x 1 root root 69720 Dec 24 15:26 coremark.exe
-rw-r--r-- 1 root root 4759 Nov 18 02:50 coremark.h
-rw-r--r-- 1 root root 283 Nov 18 02:50 coremark.md5
-rw-r--r-- 1 root root 9598 Nov 18 02:50 core_matrix.c
-rw-r--r-- 1 root root 9707 Nov 18 02:50 core_state.c
-rw-r--r-- 1 root root 6004 Nov 18 02:50 core_util.c
drwxr-xr-x 2 root root 4096 Dec 23 12:59 cygwin
drwxr-xr-x 3 root root 4096 Nov 18 02:50 docs
drwxr-xr-x 2 root root 4096 Nov 18 02:50 freebsd
-rw-r--r-- 1 root root 18582 Nov 18 02:50 LICENSE.md
drwxr-xr-x 2 root root 4096 Nov 18 02:50 linux
drwxr-xr-x 2 root root 4096 Nov 18 02:50 macos
-rw-r--r-- 1 root root 3576 Nov 18 02:50 Makefile
drwxr-xr-x 2 root root 4096 Dec 23 13:06 posix
-rw-r--r-- 1 root root 19484 Nov 18 02:50 README.md
drwxr-xr-x 2 root root 4096 Nov 18 02:50 rtems
-rw-r--r-- 1 root root 752 Dec 24 15:27 run1.log
-rw-r--r-- 1 root root 615 Dec 24 15:27 run2.log
drwxr-xr-x 2 root root 4096 Nov 18 02:50 simple
##########################################################
查看run1.log文件
[root@ecs coremark-main]# cat run1.log
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 12158
Total time (secs): 12.158000
Iterations/Sec : 16450.074025 ####此为跑的分数,该值越大代表性能越好
Iterations : 200000
Compiler version : GCC4.8.5 20150623 (Red Hat 4.8.5-44)
Compiler flags : -O2 -g -DMULTITHREAD=1 -DUSE_FORK=1 -DPERFORMANCE_RUN=1 -lrt
Memory location : Please put data memory location here(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x4983
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 16450.074025 / GCC4.8.5 20150623 (Red Hat 4.8.5-44) -O2 -g -DMULTITHREAD=1 -DUSE_FORK=1 -DPERFORMANCE_RUN=1 -lrt / Heap
五、可以跑多次计算平均值以或得最佳性能
提供脚本如下:
# -*- coding: UTF-8 -*-import subprocessimport numpy as npfile_path = "/root/coremark-main" ####解压后的coremark目录路径data_list = []def make_core():command = "make XCFLAGS='-g -DMULTITHREAD=N -DUSE_FORK=1'" ###修改N的值for i in range(3): ###修改range的值,代表跑多少次res1 = subprocess.check_output("rm -rf run* coremark.exe", shell=True, cwd=file_path)
a res2 = subprocess.check_output(command, shell=True, cwd=file_path)res3 = subprocess.check_output("sed -n 5p run1.log | awk -F [:] '{print $2}'", shell=True, cwd=file_path)data_list.append(int(res3.split(".")[0].strip()))return data_listdata_res = make_core()def arr_max():arr = data_resarr_mean = np.mean(arr) ####获得多次的平均值arr_std = np.std(arr) ####获得标准方差arr_res = format(float(arr_std)/float(arr_mean) * 100,'.6f') ###获得StdDev% 值print("arr_mean %f" % arr_mean)print("arr_std %f" % arr_std)print(arr_res)if __name__=="__main__":arr_max()执行脚本如下:
[root@ecs ~]# python make_coremark.py
arr_mean 32236.000000 ####平均值
arr_std 341.321940 ###标准方差
1.058822 ###StdDev% 值,为1.06%
对比不同cpu
多次测试结果如下:
CPU性能测试工具coremark使用相关推荐
- 电脑游戏性能测试脸型软件,CPU性能测试工具(XtremeMark)5.6.2.420 官方版
CPU性能测试工具(XtremeMark)是一款功能强大的电脑CPU性能检测工具,使用者可以通过XtremeMark进行详细的电脑数据检查,软件能够详细的列举出CPU的数据,测试结果等等,很好用的一款 ...
- 微控制器CPU性能测试基准CoreMark
origin:https://www.cnblogs.com/henjay724/p/8729364.html 痞子衡嵌入式:微控制器CPU性能测试基准(EEMBC-CoreMark) 大家好,我是痞 ...
- CPU性能测试工具-Unixbench
简介: UnixBench是一个类unix系(Unix,BSD,Linux)统下的性能测试工具,一个开源工具,被广泛用与测试linux系统主机的性能.Unixbench的主要测试项目有:系统调用.读写 ...
- CPU性能测试工具之Super PI
Super π(Pi)是Windows底下很受欢迎的测试CPU的工具,常用于硬件发烧友中对超频后的CPU进行压力测试.因其只用到基础的浮点运算,而不涉及其他的系统库环境,所以,很适合用于排查CPU物理 ...
- linux系统cpu性能测试工具
这里写自定义目录标题 uptime 欢迎使用Markdown编辑器 新的改变 功能快捷键 合理的创建标题,有助于目录的生成 如何改变文本的样式 插入链接与图片 如何插入一段漂亮的代码片 生成一个适合你 ...
- CPU性能测试工具-Linpack
简介: Linpack是我们常用的CPU性能测试程序.它通过计算双精度线性方程组的求解来测试CPU的运算能力.Intel MKL提供一个优化版本的Intel® Optimized LINPACK Be ...
- CPU性能测试及Coremark简介
衡量处理器的一个重要指标是功耗,另外一个重要指标便是性能.在处理器领域的 Benchmarks 非常众多,有某些个人开发的程序,也有某些标准组织,或者商业公司开发的Benchmarks, 本文在此不加 ...
- linux下cpu性能测试软件,Linux系统性能测试工具(四)——CPU性能测试工具之super_pi、sysbench...
在Linux系统下运行微信Web开发者工具 微信Web开发者工具只有window版本和mac版本,如果想要在Linux系统下运行微信Web开发者工具,需要花费很大周折. 注:带 * 的步骤或文件为不确 ...
- 痞子衡嵌入式:微控制器CPU性能测试基准(EEMBC-CoreMark)
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是微控制器CPU性能测试基准CoreMark. 在嵌入式系统行业用于评价CPU性能指标的标准主要有三种:Dhrystone.MIPS.Co ...
最新文章
- 服务注册发现consul之四: 分布式锁之四:基于Consul的KV存储和分布式信号量实现分布式锁...
- C# 2.0 的partial
- 检查多边形是否包含了某点(经纬度)
- 用typescript开发koa2的二三事
- 双机通信c语言程序,上传一个自己编写的I2C双机通信程序
- win 8 共享连接数是多少_局域网IP限速怎么配置,限速多少比较合适
- 超大整数相加,超过了long的范围,你要怎么做
- linux -小记(3) 问题:linux 安装epel扩展源报错
- VMware vSphere 5.x 与 vSphere 6.0各版本功能特性对比
- mysql 左连接 左外连接吗_数据库左连接和左外连接有区别吗
- 第十三章 音视频播放——Qt
- 服务器搭建免流系统,国内服务器搭建免流
- android平板电脑的虚拟键盘,win10平板电脑不弹出虚拟键盘的两种解决方法
- 模块独立性与高内聚低耦合
- 商业智能中的决策, 数据和数据处理方法
- 7.4 小团队、低成本的管理实践之路
- 阿里云部署K8s及一些排错体会
- 为什么戏说php,戏说PHP——1. 1切的开始
- PHP学习——4 Integer类型
- 【杂烩】MarkText+PicGo