1. 下载
http://www.bitmover.com/lmbench/lmbench2.tar.gz
2. 编译
$tar -xf lmbench2.tar.gz
$cd lmbench2
$mkdir ./SCCS
$touch ./SCCS/s.ChangeSet
$make
3. 测试
$ make results see
在我的机器上显示:
pwrp@Joseph:~/Desktop/lmbench2$ make results see cd src && make results make[1]: Entering directory `/home/pwrp/Desktop/lmbench2/src' make[2]: Entering directory `/home/pwrp/Desktop/lmbench2/src' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/pwrp/Desktop/lmbench2/src' ===================================================================== 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. ===================================================================== Hang on, we are calculating your timing granularity. OK, it looks like you can time stuff down to 1000000 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.00025656 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 529] Checking to see if you have 529 MB; please wait for a moment... 529MB OK 529MB OK 529MB OK ===================================================================== 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. If you are measuring software only, you probably want to do a fast run, so answer yes below. 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] ===================================================================== Calculating mhz, please wait for a moment... mhz: should take approximately 297 seconds I think your CPU mhz is 4907 MHz, 0.20 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. Type in just the Mhz part, like 3060 or 2800 for 3.06GHz or 2.8GHz P4s. Processor mhz [default 4907 MHz, 0.20 nanosec clock] ===================================================================== We need a place to store a 264 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 /tmp] ===================================================================== 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] ===================================================================== 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] ===================================================================== Please tell us about your machine. There is a form we would like you to fill out that we will make available with the results. If you would prefer to use a different editor, tell us the editor at the prompt. If you want to skip filling out this form (please don't) then answer "none" at the prompt. Editor [default vi] ===================================================================== Configuration done, thanks. There is a mailing list for discussing lmbench hosted at BitMover. Send mail to [email protected] to join the list. Results going to ../results/i686-pc-linux-gnu/Joseph.0 Using config in CONFIG.Joseph Mon Apr 11 05:25:21 EDT 2011 Latency measurements
最后的测试结果概要:
Using config in CONFIG.Joseph Mon Apr 11 05:25:21 EDT 2011 Latency measurements L M B E N C H 2 . 0 S U M M A R Y ------------------------------------ Basic system parameters ---------------------------------------------------- Host OS Description Mhz --------- ------------- ----------------------- ---- Joseph Linux 2.6.26- i686-pc-linux-gnu 4907 Processor, Processes - times in microseconds - smaller is better ---------------------------------------------------------------- Host OS Mhz null null open selct sig sig fork exec sh call I/O stat clos TCP inst hndl proc proc proc --------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- Joseph Linux 2.6.26- 4907 0.20 0.46 1.85 2.88 5.757 0.66 2.99 150. 757. 4777 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 --------- ------------- ----- ------ ------ ------ ------ ------- ------- Joseph Linux 2.6.26- 4.380 7.8900 18.3 9.2600 45.0 14.4 48.7 *Local* Communication latencies in microseconds - smaller is better ------------------------------------------------------------------- Host OS 2p/0K Pipe AF UDP RPC/ TCP RPC/ TCP ctxsw UNIX UDP TCP conn --------- ------------- ----- ----- ---- ----- ----- ----- ----- ---- Joseph Linux 2.6.26- 4.380 19.8 21.6 27.6 29.6 34.9 42.1 File & VM system latencies in microseconds - smaller is better -------------------------------------------------------------- Host OS 0K File 10K File Mmap Prot Page Create Delete Create Delete Latency Fault Fault --------- ------------- ------ ------ ------ ------ ------- ----- ----- Joseph Linux 2.6.26- 12.1 7.0750 51.6 17.6 4105.0 0.762 2.00000 *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 --------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- ----- Joseph Linux 2.6.26- 1080 1348 361. 1178.2 1226.2 463.9 455.8 1205 679.9 Memory latencies in nanoseconds - smaller is better (WARNING - may not be correct, check graphs) --------------------------------------------------- Host OS Mhz L1 $ L2 $ Main mem Guesses --------- ------------- ---- ----- ------ -------- ------- Joseph Linux 2.6.26- 4907 0.716 7.0860 205.4
在results/i686-pc-linux-gnu/Joseph.0下有相应的测试数据。
更多的了解lmbench 请浏览其主页
lmbench主页:http://www.bitmover.com/lmbench/lmbench.html#TOC