摘要:LMbench是一套用于UNIX/POSIX的简单、可移植的ANSI/C微基准测试。一般来说,它测量两个关键特征:延迟和带宽。lmbench旨在让系统开发人员了解关键操作的基本成本。
一、LMbench是什么?
-
一套简单、可移植的基准测试
-
比较不同的 系统性能
-
大多数主要供应商(SUN, HP, IBM, DEC, SGI, PCs including 200 Mhz P6’s)均可获得结果
-
GNU 通用公共许可证涵盖的自由软件。
-
带宽基准
1. 缓存文件读取
2. 内存复制 (bcopy)
3. 内存读取
4. 内存写入
5. Pipe管道
6. TCP 协议 -
延迟基准
1. 上下文切换。
2. 组网:连接建立、管道、TCP、UDP 和 RPC 烫手山芋
3. 文件系统创建和删除。
4. 流程创建。
5. 信号处理
6. 系统调用开销
7. 内存读取延迟 -
其他
处理器时钟速率计算
二、获取LMbench源码
LMbench官网:https://lmbench.sourceforge.net
源码下载:https://sourceforge.net/projects/lmbench/
当前版本为:lmbench-3.0-a9.tgz
LMbench目录解构:
lmbench/
Results/
doc/
scripts/
src/
三、龙芯平台运行LMbench
3.1 硬件平台
LS3A6000 NUC 迷你机器
3.2 软件环境
龙芯loongnix20.6操作系统
3.3 开始运行
- 解压LMbench源码包
tar -zxvf lmbench-3.0-a9.tgz
- 进入lmbench目录下
cd lmbench-3.0-a9
- 开始运行
cd src && make results
示例中,两次输入地方:
- 输入测试内存大小为:1000MB
- 邮件结果时,选择no
- 其他选择默认
3.4 运行出错
1. 运行报错1
- linux usr/bin/ld:找不到-ltirpc
解决方案:
sudo apt-get install libtirpc-dev
2. 运行报错2
解决方案:
-
修改lmbench-3.0-a9/scripts/results
-
vim scripts/results +31
-
再重新执行
cd src && make results
正常执行log如下所示:
cd src/ && make results
lmbench-3.0-a9# cd src/ && make results
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
make[1]: 进入目录“/home/damao/work/lmbench-test/3.0/lmbench-3.0-a9/src”
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_tcp.c -o ../bin//lib_tcp.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_udp.c -o ../bin//lib_udp.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_unix.c -o ../bin//lib_unix.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_timing.c -o ../bin//lib_timing.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_mem.c -o ../bin//lib_mem.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_stats.c -o ../bin//lib_stats.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_debug.c -o ../bin//lib_debug.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c getopt.c -o ../bin//getopt.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -c lib_sched.c -o ../bin//lib_sched.o
lib_sched.c: In function ‘sched_pin’:
lib_sched.c:208:12: warning: implicit declaration of function ‘sched_getaffinity’; did you mean ‘sched_getparam’? [-Wimplicit-function-declaration]
retval = sched_getaffinity(0, sz * sizeof(unsigned long), cpumask);
^~~~~~~~~~~~~~~~~
sched_getparam
lib_sched.c:232:11: warning: implicit declaration of function ‘sched_setaffinity’; did you mean ‘sched_setparam’? [-Wimplicit-function-declaration]
retval = sched_setaffinity(0, sz * sizeof(unsigned long), mask);
^~~~~~~~~~~~~~~~~
sched_setparam
/bin/rm -f ../bin//lmbench.a
ar cr ../bin//lmbench.a ../bin//lib_tcp.o ../bin//lib_udp.o ../bin//lib_unix.o ../bin//lib_timing.o ../bin//lib_mem.o ../bin//lib_stats.o ../bin//lib_debug.o ../bin//getopt.o ../bin//lib_sched.o
ranlib ../bin//lmbench.a
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_file_rd bw_file_rd.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_mem bw_mem.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_mmap_rd bw_mmap_rd.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_pipe bw_pipe.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_tcp bw_tcp.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//bw_unix bw_unix.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//hello hello.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_select lat_select.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_pipe lat_pipe.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_rpc lat_rpc.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_syscall lat_syscall.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_tcp lat_tcp.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_udp lat_udp.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_mmap lat_mmap.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//mhz mhz.c ../bin//lmbench.a -lm -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_proc lat_proc.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_pagefault lat_pagefault.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_connect lat_connect.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_fs lat_fs.c ../bin//lmbench.a -lm
/usr/bin/ld: /tmp/cceXbEtd.o: in function `.L107':
lat_fs.c:(.text+0xa8c): 警告:the use of `tempnam' is dangerous, better use `mkstemp'
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_sig lat_sig.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_mem_rd lat_mem_rd.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_ctx lat_ctx.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_sem lat_sem.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//memsize memsize.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_unix lat_unix.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lmdd lmdd.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//timing_o timing_o.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//enough enough.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//msleep msleep.c
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//loop_o loop_o.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_fifo lat_fifo.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lmhttp lmhttp.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_http lat_http.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_fcntl lat_fcntl.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//disk disk.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_unix_connect lat_unix_connect.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -DMAIN -o ../bin//flushdisk flushdisk.c
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_ops lat_ops.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//line line.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//tlb tlb.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//par_mem par_mem.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//par_ops par_ops.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//stream stream.c ../bin//lmbench.a -lm
rm -f ../bin//lmbench
VERSION=`../scripts/version`; \
sed -e "s/<version>/${VERSION}/g" < ../scripts/lmbench > ../bin//lmbench
chmod +x ../bin//lmbench
make[1]: 离开目录“/home/damao/work/lmbench-test/3.0/lmbench-3.0-a9/src”
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
make[1]: 进入目录“/home/damao/work/lmbench-test/3.0/lmbench-3.0-a9/src”
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//cache cache.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_dram_page lat_dram_page.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_pmake lat_pmake.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_rand lat_rand.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_usleep lat_usleep.c ../bin//lmbench.a -lm
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_pmap_clnt_h -DHAVE_socklen_t -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin//lat_cmd lat_cmd.c ../bin//lmbench.a -lm
make[1]: 离开目录“/home/damao/work/lmbench-test/3.0/lmbench-3.0-a9/src”
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
=====================================================================
L M B E N C H C ON F I G U R A T I O N
----------------------------------------
You need to configure some parameters to lmbench. Once you have configured
these parameters, you may do multiple runs by saying
"make rerun"
in the src subdirectory.
NOTICE: please do not have any other activity on the system if you can
help it. Things like the second hand on your xclock or X perfmeters
are not so good when benchmarking. In fact, X is not so good when
benchmarking.
=====================================================================
If you are running on an MP machine and you want to try running
multiple copies of lmbench in parallel, you can specify how many here.
Using this option will make the benchmark run 100x slower (sorry).
NOTE: WARNING! This feature is experimental and many results are
known to be incorrect or random!
MULTIPLE COPIES [default 1]:
=====================================================================
Options to control job placement
1) Allow scheduler to place jobs
2) Assign each benchmark process with any attendent child processes
to its own processor
3) Assign each benchmark process with any attendent child processes
to its own processor, except that it will be as far as possible
from other processes
4) Assign each benchmark and attendent processes to their own
processors
5) Assign each benchmark and attendent processes to their own
processors, except that they will be as far as possible from
each other and other processes
6) Custom placement: you assign each benchmark process with attendent
child processes to processors
7) Custom placement: you assign each benchmark and attendent
processes to processors
Note: some benchmarks, such as bw_pipe, create attendent child
processes for each benchmark process. For example, bw_pipe
needs a second process to send data down the pipe to be read
by the benchmark process. If you have three copies of the
benchmark process running, then you actually have six processes;
three attendent child processes sending data down the pipes and
three benchmark processes reading data and doing the measurements.
Job placement selection [default 1]:
=====================================================================
Hang on, we are calculating your timing granularity.
OK, it looks like you can time stuff down to 5000 usec resolution.
Hang on, we are calculating your timing overhead.
OK, it looks like your gettimeofday() costs 0 usecs.
Hang on, we are calculating your loop overhead.
OK, it looks like your benchmark loop costs 0.00000171 usecs.
=====================================================================
Several benchmarks operate on a range of memory. This memory should be
sized such that it is at least 4 times as big as the external cache[s]
on your system. It should be no more than 80% of your physical memory.
The bigger the range, the more accurate the results, but larger sizes
take somewhat longer to run the benchmark.
MB [default 22725]: 1000
Checking to see if you have 1000 MB; please wait for a moment...
1000MB OK
1000MB OK
1000MB OK
Hang on, we are calculating your cache line size.
OK, it looks like your cache line is 64 bytes.
=====================================================================
lmbench measures a wide variety of system performance, and the full suite
of benchmarks can take a long time on some platforms. Consequently, we
offer the capability to run only predefined subsets of benchmarks, one
for operating system specific benchmarks and one for hardware specific
benchmarks. We also offer the option of running only selected benchmarks
which is useful during operating system development.
Please remember that if you intend to publish the results you either need
to do a full run or one of the predefined OS or hardware subsets.
SUBSET (ALL|HARWARE|OS|DEVELOPMENT) [default all]:
=====================================================================
This benchmark measures, by default, memory latency for a number of
different strides. That can take a long time and is most useful if you
are trying to figure out your cache line size or if your cache line size
is greater than 128 bytes.
If you are planning on sending in these results, please don't do a fast
run.
Answering yes means that we measure memory latency with a 128 byte stride.
FASTMEM [default no]:
=====================================================================
This benchmark measures, by default, file system latency. That can
take a long time on systems with old style file systems (i.e., UFS,
FFS, etc.). Linux' ext2fs and Sun's tmpfs are fast enough that this
test is not painful.
If you are planning on sending in these results, please don't do a fast
run.
If you want to skip the file system latency tests, answer "yes" below.
SLOWFS [default no]:
=====================================================================
This benchmark can measure disk zone bandwidths and seek times. These can
be turned into whizzy graphs that pretty much tell you everything you might
need to know about the performance of your disk.
This takes a while and requires read access to a disk drive.
Write is not measured, see disk.c to see how if you want to do so.
If you want to skip the disk tests, hit return below.
If you want to include disk tests, then specify the path to the disk
device, such as /dev/sda. For each disk that is readable, you'll be
prompted for a one line description of the drive, i.e.,
Iomega IDE ZIP
or
HP C3725S 2GB on 10MB/sec NCR SCSI bus
DISKS [default none]:
=====================================================================
If you are running on an idle network and there are other, identically
configured systems, on the same wire (no gateway between you and them),
and you have rsh access to them, then you should run the network part
of the benchmarks to them. Please specify any such systems as a space
separated list such as: ether-host fddi-host hippi-host.
REMOTE [default none]:
=====================================================================
Calculating mhz, please wait for a moment...
I think your CPU mhz is
2499 MHz, 0.4002 nanosec clock
but I am frequently wrong. If that is the wrong Mhz, type in your
best guess as to your processor speed. It doesn't have to be exact,
but if you know it is around 800, say 800.
Please note that some processors, such as the P4, have a core which
is double-clocked, so on those processors the reported clock speed
will be roughly double the advertised clock rate. For example, a
1.8GHz P4 may be reported as a 3592MHz processor.
Processor mhz [default 2499 MHz, 0.4002 nanosec clock]:
=====================================================================
We need a place to store a 1000 Mbyte file as well as create and delete a
large number of small files. We default to /usr/tmp. If /usr/tmp is a
memory resident file system (i.e., tmpfs), pick a different place.
Please specify a directory that has enough space and is a local file
system.
FSDIR [default /var/tmp]:
=====================================================================
lmbench outputs status information as it runs various benchmarks.
By default this output is sent to /dev/tty, but you may redirect
it to any file you wish (such as /dev/null...).
Status output file [default /dev/tty]:
=====================================================================
There is a database of benchmark results that is shipped with new
releases of lmbench. Your results can be included in the database
if you wish. The more results the better, especially if they include
remote networking. If your results are interesting, i.e., for a new
fast box, they may be made available on the lmbench web page, which is
http://www.bitmover.com/lmbench
Mail results [default yes]: no
OK, no results mailed.
=====================================================================
Confguration done, thanks.
There is a mailing list for discussing lmbench hosted at BitMover.
Send mail to majordomo@bitmover.com to join the list.
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
../scripts/gnu-os: unable to guess system type
This script, last modified 2004-08-18, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (../scripts/gnu-os) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-08-18
uname -m = loongarch64
uname -r = 4.19.0-19-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
/usr/bin/uname -p = loongarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = loongarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = loongarch64
UNAME_RELEASE = 4.19.0-19-loongson-3
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP 4.19.190.8.22 Wed Jul 10 01:32:32 UTC 2024
Using config in CONFIG.damao-pc
2024年 11月 08日 星期五 14:19:34 CST
Latency measurements
2024年 11月 08日 星期五 14:19:55 CST
Calculating file system latency
2024年 11月 08日 星期五 14:19:57 CST
Local networking
2024年 11月 08日 星期五 14:21:08 CST
Bandwidth measurements
2024年 11月 08日 星期五 14:21:44 CST
Calculating context switch overhead
2024年 11月 08日 星期五 14:21:48 CST
Calculating effective TLB size
2024年 11月 08日 星期五 14:21:50 CST
Calculating memory load parallelism
2024年 11月 08日 星期五 14:25:52 CST
McCalpin's STREAM benchmark
2024年 11月 08日 星期五 14:25:57 CST
Calculating memory load latency
2024年 11月 08日 星期五 14:37:09 CST
3.5 查看结果
执行make see
查看结果
重点:执行如下命令才能看到结果
cd results && make LIST=`uname -n`
结果展示:
results# make LIST=damao-pc
L M B E N C H 3 . 0 S U M M A R Y
------------------------------------
(Alpha software, do not distribute)
Basic system parameters
------------------------------------------------------------------------------
Host OS Description Mhz tlb cache mem scal
pages line par load
bytes
--------- ------------- ----------------------- ---- ----- ----- ------ ----
damao-pc Linux 4.19.0- damao-pc 2499 66 64 9.3300 1
Processor, Processes - times in microseconds - smaller is better
------------------------------------------------------------------------------
Host OS Mhz null null open slct sig sig fork exec sh
call I/O stat clos TCP inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
damao-pc Linux 4.19.0- 2499
Basic integer operations - times in nanoseconds - smaller is better
-------------------------------------------------------------------
Host OS intgr intgr intgr intgr intgr
bit add mul div mod
--------- ------------- ------ ------ ------ ------ ------
damao-pc Linux 4.19.0-
Basic uint64 operations - times in nanoseconds - smaller is better
------------------------------------------------------------------
Host OS int64 int64 int64 int64 int64
bit add mul div mod
--------- ------------- ------ ------ ------ ------ ------
damao-pc Linux 4.19.0-
Basic float operations - times in nanoseconds - smaller is better
-----------------------------------------------------------------
Host OS float float float float
add mul div bogo
--------- ------------- ------ ------ ------ ------
damao-pc Linux 4.19.0-
Basic double operations - times in nanoseconds - smaller is better
------------------------------------------------------------------
Host OS double double double double
add mul div bogo
--------- ------------- ------ ------ ------ ------
damao-pc Linux 4.19.0-
Context switching - times in microseconds - smaller is better
-------------------------------------------------------------------------
Host OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw
--------- ------------- ------ ------ ------ ------ ------ ------- -------
damao-pc Linux 4.19.0- 0.9800 1.1200 1.3500 1.3000 2.3100 2.37000 2.17000
*Local* Communication latencies in microseconds - smaller is better
---------------------------------------------------------------------
Host OS 2p/0K Pipe AF UDP RPC/ TCP RPC/ TCP
ctxsw UNIX UDP TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
damao-pc Linux 4.19.0- 0.980 16.0 19.9 19.9 23.5 49.
*Remote* Communication latencies in microseconds - smaller is better
---------------------------------------------------------------------
Host OS UDP RPC/ TCP RPC/ TCP
UDP TCP conn
--------- ------------- ----- ----- ----- ----- ----
damao-pc Linux 4.19.0-
File & VM system latencies in microseconds - smaller is better
-------------------------------------------------------------------------------
Host OS 0K File 10K File Mmap Prot Page 100fd
Create Delete Create Delete Latency Fault Fault selct
--------- ------------- ------ ------ ------ ------ ------- ----- ------- -----
damao-pc Linux 4.19.0- 23.2 11.6 33.7 16.0 2669.0
*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------------------------
Host OS Pipe AF TCP File Mmap Bcopy Bcopy Mem Mem
UNIX reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
damao-pc Linux 4.19.0- 4523 5313 2540 6585.9 18.3K 12.0K 7766.3 13.K 9786.
Memory latencies in nanoseconds - smaller is better
(WARNING - may not be correct, check graphs)
------------------------------------------------------------------------------
Host OS Mhz L1 $ L2 $ Main mem Rand mem Guesses
--------- ------------- --- ---- ---- -------- -------- -------
damao-pc Linux 4.19.0- 2499 1.2010 4.8070 37.8 103.5