再谈lmbench

摸了一轮ltp-ddt

再回头来看lmbench

bandwidth & latency合集小王子 用起来确实方便。

只是官网显示的用法是:

Go to the top directory, and type make results see and then have a while it goes to work. The benchmark takes about a half hour (or more on slow machines) to run.

在板子上没法跑起来,make results see 是现编译现跑。

只能分析一下Makefile,看看如何手动运行。

ltp-ddt中是直接调用一个一个binary

比如bw_mem $i $op

bw_unix等

make results see

Makefile中:

results: FRC
    cd src && $(MAKE) results

see:
    cd results && $(MAKE) summary percent 2>/dev/null | more

再看src中的Makefile

results: lmbench
    @env OS="${OS}" ../scripts/config-run
    @env OS="${OS}" ../scripts/results

get 手动就是运行config-run和results两个脚本

但是要进入到scripts文件夹,否则会因为路径关系有些文件找不到。

再来看看config-run

用来配置一堆东西,仔细阅读做选择

results

cd ../bin/$OS
PATH=.:${PATH}; export PATH
export SYNC_MAX
export OUTPUT
lmbench $CONFIG 2>../${RESULTS} #关键是这句

if [ X$MAIL = Xyes ]
then    echo Mailing results
    (echo ---- $INFO ---
    cat $INFO
    echo ---- $RESULTS ---
    cat ../$RESULTS) | mail lmbench3@bitmover.com
fi

原文地址:https://www.cnblogs.com/idyllcheung/p/11250584.html