LLCbench的安装和使用 ubuntu入门之十六

这篇博客介绍了如何使用LLCbench进行Linux系统中内存缓存性能的测试,并详细展示了在执行`make cache-bench`时遇到的编译警告及解决方法。通过`cache-bench`实例,读者可以了解如何配置和运行该工具来评估不同内存设置下的性能变化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

user@localhost:~$ tar -zxf llcbench.tar.gz 
user@localhost:~$ ls
Desktop    Image-xenomai-dele-x100-20220520a  Public     bin  libexec                           llcbench         perf-pc         test          ubuntu-kde-test.tar.gz
Documents  Music                              Templates  etc  linux-4.19-master-xenomai         llcbench.tar.gz  perf-test-data  test1         xenomai-v3.1.2
Downloads  Pictures                           Videos     lib  linux-4.19-master-xenomai.tar.gz  perf             share           test1.tar.gz  xenomai-v3.1.2.tar.bz2
user@localhost:~$ cd llcbench
user@localhost:~/llcbench$ ls
CHANGES  COPYING  Makefile  README  blasbench  cachebench  conf  doc  flushall.c  llcbench.h  misc  mpbench  results  sys.def  timer.c  user.def  www
user@localhost:~/llcbench$ ls
CHANGES  COPYING  Makefile  README  blasbench  cachebench  conf  doc  flushall.c  llcbench.h  misc  mpbench  results  sys.def  timer.c  user.def  www
user@localhost:~/llcbench$ make

Please use one of the following targets:

	alpha
	alpha-mpich
	linux-lam
	linux-mpich
	linux-opteron-mpich-acml
	ia64-mpich-ecc
	o2000
	pow2
	pow3
	ppc
	solaris
	solaris-mpich
	t3e
	reconfig (to bring this menu up again)

After configuration, please check the VBLASLIB variable in 
sys.def and make sure that it is pointing to the vendor BLAS
library if one exists.
user@localhost:~/llcbench$ make linux-lam
ln -s conf/sys.linux-lam sys.def
user@localhost:~/llcbench$ make
Please use one of the following targets:

For all three : compile, run, script, graph, clean, clobber, reconfig
For BlasBench : blas-bench, blas-run, blas-script, blas-graph
For CacheBench: cache-bench, cache-run, cache-script, cache-graph
For MPBench   : mp-bench, mp-run, mp-script, mp-graph

clean: removes object files and leaves result files
clobber: removes binary files and leaves result files
distclean: removes everything!
user@localhost:~/llcbench$ make cache-bench
cd cachebench; make 
make[1]: Entering directory '/home/user/llcbench/cachebench'
gcc -c -I.. ../flushall.c
gcc -O -Wall -c -I.. ../timer.c
gcc -O -Wall -DUSE_DOUBLE -I.. cachebench.c flushall.o timer.o -lrt -o cachebench
In file included from cachebench.c:10:
cachebench.c: In function ‘fake_out_optimizations’:
cachebench.c:296:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  296 |     assert(fd=open("/dev/null",O_WRONLY));
      |            ^~
cachebench.c: In function ‘do_memory_copy’:
cachebench.c:712:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  712 |   assert(y = (void *)malloc(memsize));
      |          ^
cachebench.c: In function ‘main’:
cachebench.c:947:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  947 |   assert(sizes = (long *)malloc(timeslots*sizeof(long)));
      |          ^~~~~
cachebench.c:949:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  949 |   assert(times = (double *)malloc(timeslots*repeat_count*sizeof(double)));
      |          ^~~~~
cachebench.c:951:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  951 |   assert(bws = (double *)malloc(timeslots*repeat_count*sizeof(double)));
      |          ^~~
cachebench.c:953:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  953 |   assert(percents = (double *)malloc(timeslots*repeat_count*sizeof(double)));
      |          ^~~~~~~~
cachebench.c:955:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  955 |   assert(x = (DATATYPE *)malloc((size_t)memsize));
      |          ^
make[1]: Leaving directory '/home/user/llcbench/cachebench'
user@localhost:~/llcbench$ ls
CHANGES  COPYING  Makefile  README  blasbench  cachebench  conf  doc  flushall.c  llcbench.h  misc  mpbench  results  sys.def  timer.c  user.def  www

cd cachebench; make 
make[1]: Entering directory '/home/user/llcbench/cachebench'
make[1]: 'cachebench' is up to date.
make[1]: Leaving directory '/home/user/llcbench/cachebench'
user@localhost:~/llcbench$ ls
CHANGES  COPYING  Makefile  README  blasbench  cachebench  conf  doc  flushall.c  llcbench.h  misc  mpbench  results  sys.def  timer.c  user.def  www
user@localhost:~/llcbench$ ls cachebench/
Makefile  cachebench  cachebench.c  cachegraph.gp  flushall.o  scripts  timer.o

user@localhost:~/llcbench$ cd cachebench/
user@localhost:~/llcbench/cachebench$ ./cachebench 

		Memory Set Library Cache Test

C Size		Nanosec		MB/sec		% Chnge
-------		-------		-------		-------
256             0.07            14006.49        1.00           
256             0.07            14007.11        1.00           
384             0.06            15007.76        0.93           
384             0.06            15007.85        1.00           
512             0.06            15563.79        0.96           
512             0.06            15563.29        1.00           
768             0.06            16162.41        0.96           
768             0.06            16162.38        1.00           
1024            0.06            16479.09        0.98           
1024            0.06            16479.26        1.00           
1536            0.06            16808.87        0.98           
1536            0.06            16792.13        1.00           
2048            0.06            16977.96        0.99 

参考:

使用llcbench测试缓存性能
https://blog.csdn.net/leishangwen/article/details/43339887

LLCbench - Low Level Architectural Characterization Benchmark Suite
https://icl.cs.utk.edu/llcbench/index.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值