使用unixbench测试嵌入式设备性能

隆璞
2023-12-01

源码路径

git@github.com:kdlucas/byte-unixbench.git

需要支持的工具

perl
tar 支持 -xz

unixbench的使用

UnixBench是一个类unix系(Unix,BSD,Linux)统下的性能测试工具,一个开源工具,被广泛用与测试linux系统主机的性能。Unixbench的主要测试项目有:系统调用、读写、进程、图形化测试、2D、
3D、管道、运算、C库等系统基准性能提供测试数据。

最新版本UnixBench5.1.3,包含system和graphic测试,如果你需要测试graphic,则需要修改Makefile,不要注释掉”GRAPHIC_TESTS = defined”,同时需要系统提供x11perf命令gl_glibs库。

从以上github上下载的unixbench 是打过patch的版本,为了解决虚拟机下的多进程运算不准的问题,参考案例:https://blog.csdn.net/jus3ve/article/details/80921073

默认是注释掉了图形测试:#GRAPHIC_TESTS = defined

测试项目

Dhrystone测试

测试聚焦在字符串处理,没有浮点运算操作。这个测试用于测试链接器编译、代码优化、内存缓存、等待状态、整数数据类型等,硬件和软件设计都会非常大的影响测试结果。

Whetstone 测试

这项测试项目用于测试浮点运算效率和速度。这项测试项目包含若干个科学计算的典型性能模块,包含大量的C语言函数,sin cos sqrt exp和日志以及使用整数和浮点的数学操作。包含数组访问、条件分支和过程调用。

Execl Throughput(execl 吞吐,这里的execl是类unix系统非常重要的函数,非办公软件的execl)测试

这项测试测试每秒execl函数调用次数。execl是 exec函数家族的一部分,使用新的图形处理代替当前的图形处理。有许多命令和前端的execve()函数命令非常相似。

File Copy测试

这项测试衡量文件数据从一个文件被传输到另外一个,使用大量的缓存。包括文件的读、写、复制测试,测试指标是一定时间内(默认是10秒)被重写、读、复制的字符数量。

Pipe Throughput(管道吞吐)测试

pipe是简单的进程之间的通讯。管道吞吐测试是测试在一秒钟一个进程写512比特到一个管道中并且读回来的次数。管道吞吐测试和实际编程有差距。

Pipe-based Context Switching (基于管道的上下文交互)测试

这项测试衡量两个进程通过管道交换和整数倍的增加吞吐的次数。基于管道的上下文切换和真实程序很类似。测试程序产生一个双向管道通讯的子线程。

Process Creation(进程创建)测试

这项测试衡量一个进程能产生子线程并且立即退出的次数。新进程真的创建进程阻塞和内存占用,所以测试程序直接使用内存带宽。这项测试用于典型的比较大量的操作系统进程创建操作。

Shell Scripts测试

shell脚本测试用于衡量在一分钟内,一个进程可以启动并停止shell脚本的次数,通常会测试1,2, 3, 4, 8 个shell脚本的共同拷贝,shell脚本是一套转化数据文件的脚本。

System Call Overhead (系统调用消耗)测试

这项测试衡量进入和离开系统内核的消耗,例如,系统调用的消耗。程序简单重复的执行getpid调用(返回调用的进程id)。消耗的指标是调用进入和离开内核的执行时间。

Graphical Tests(图形)测试

由”ubgears”程序组成,测试非常粗的2D和3D图形性能,尤其是3D测试非常有限。测试结果和硬件,系统合适的驱动关系很大。

A113D的测试结果

   Version 5.1.3 Based on the Byte Magazine Unix Benchmark

   Multi-CPU version Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011 johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /root/UnixBench/tmp
      * Results = /root/UnixBench/results
------------------------------------------------------------------------------


1 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput 1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks 1 2 3

1 x File Copy 256 bufsize 500 maxblocks 1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks 1 2 3

1 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10

1 x Process Creation 1 2 3

1 x System Call Overhead 1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent) 1 2 3

1 x Shell Scripts (8 concurrent) 1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: buildroot: GNU/Linux
   OS: GNU/Linux -- 4.9.113 -- #1 SMP PREEMPT Mon Mar 11 18:46:12 CST 2019
   Machine: aarch64 (unknown)
   Language: (charmap=, collate=)
   13:38:28 up 1:07, load average: 0.12, 0.24, 0.44; runlevel 

------------------------------------------------------------------------
Benchmark Run: Thu Mar 14 2019 13:38:28 - 14:06:28
0 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        6502322.9 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     1283.7 MWIPS (9.9 s, 7 samples)
Execl Throughput                                715.7 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        114022.8 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           33208.3 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        316673.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                              231109.1 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  46058.1 lps   (10.0 s, 7 samples)
Process Creation                               2078.8 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   2220.7 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    666.3 lpm   (60.1 s, 2 samples)
System Call Overhead                         463631.2 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    6502322.9    557.2
Double-Precision Whetstone                       55.0       1283.7    233.4
Execl Throughput                                 43.0        715.7    166.5
File Copy 1024 bufsize 2000 maxblocks          3960.0     114022.8    287.9
File Copy 256 bufsize 500 maxblocks            1655.0      33208.3    200.7
File Copy 4096 bufsize 8000 maxblocks          5800.0     316673.8    546.0
Pipe Throughput                               12440.0     231109.1    185.8
Pipe-based Context Switching                   4000.0      46058.1    115.1
Process Creation                                126.0       2078.8    165.0
Shell Scripts (1 concurrent)                     42.4       2220.7    523.8
Shell Scripts (8 concurrent)                      6.0        666.3   1110.5
System Call Overhead                          15000.0     463631.2    309.1
                                                                   ========
System Benchmarks Index Score                                         294.9

S805的Unixbench测试

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /root/UnixBench/tmp
      * Results                      = /root/UnixBench/results
------------------------------------------------------------------------------


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

3 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

3 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

3 x Execl Throughput  1 2 3

3 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

3 x File Copy 256 bufsize 500 maxblocks  1 2 3

3 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

3 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

3 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

3 x Process Creation  1 2 3

3 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

3 x Shell Scripts (1 concurrent)  1 2 3

3 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: OTCloud_0518: GNU/Linux
   OS: GNU/Linux -- 3.10.33 -- #1 SMP PREEMPT Mon Mar 11 21:33:47 CST 2019 XL-V2.2.0
   Machine: armv7l (unknown)
   Language:  (charmap=, collate=)
   19:25:17 up  2:00,  load average: 0.05, 0.17, 0.32; runlevel 

------------------------------------------------------------------------
Benchmark Run: Fri Mar 15 2019 19:25:17 - 19:53:30
3 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        3597117.5 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                      611.9 MWIPS (10.0 s, 7 samples)
Execl Throughput                                526.9 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         81424.3 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           23987.6 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        211697.1 KBps  (30.0 s, 2 samples)
Pipe Throughput                              210599.2 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  38397.9 lps   (10.0 s, 7 samples)
Process Creation                               1865.2 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   1491.6 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    350.0 lpm   (60.1 s, 2 samples)
System Call Overhead                         745433.9 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    3597117.5    308.2
Double-Precision Whetstone                       55.0        611.9    111.3
Execl Throughput                                 43.0        526.9    122.5
File Copy 1024 bufsize 2000 maxblocks          3960.0      81424.3    205.6
File Copy 256 bufsize 500 maxblocks            1655.0      23987.6    144.9
File Copy 4096 bufsize 8000 maxblocks          5800.0     211697.1    365.0
Pipe Throughput                               12440.0     210599.2    169.3
Pipe-based Context Switching                   4000.0      38397.9     96.0
Process Creation                                126.0       1865.2    148.0
Shell Scripts (1 concurrent)                     42.4       1491.6    351.8
Shell Scripts (8 concurrent)                      6.0        350.0    583.3
System Call Overhead                          15000.0     745433.9    497.0
                                                                   ========
System Benchmarks Index Score                                         217.5
 类似资料: