Lmbench is a portable, platform-open source benchmark for evaluating the overall performance of a system, capable of testing performance including document reading and writing, memory operations, process creation and destruction overhead, and networking. You can migrate Lmbench to Android by following these steps.
1. Download Lmbench Source
Transmission door: http://www.bitmover.com/lmbench/get_lmbench.html
2. Edit Scripts/os Add Os=arm-linux
$vim Scripts/os
#!/bin/sh
If ["X$os"!= "x"] && echo "$OS" | grep-q ' "then
os=
fi
If [" X$os "=" x "]
then os=bloat-os
machine= ' uname-m | sed-e ' s///g ' | sed-e ' s?/?-? g ' ' system= ' uname-s
| sed-e ' s///g ' | Sed-e ' s?/?-? g '
os= ' ${machine}-${system} '
if [f ... /scripts/gnu-os]
then os= '. /scripts/gnu-os | Sed s/unknown-//'
fi
if [f.. /.. /scripts/gnu-os]
then os= '. /.. /scripts/gnu-os | Sed s/unknown-//'
fi
fi
#add arm-linux
os=arm-linux
Echo $OS
3. Edit Scripts/compiler Add CC=ARM-LINUX-GCC
$vim Scripts/compiler
#!/bin/sh
If ["X$CC"!= "X"] && echo "$CC" | grep-q ' "then
cc=
fi
if [X$CC = X]
the n cc=cc for
p in ' echo $PATH | sed ' s/://g ' "
do if [-f $p/GCC]
then cc=gcc
fi
Done
fi
#add arm-linux-gcc
cc=arm-linux-gcc
Echo $CC
4. Edit Src/makefile Specify linker
62 lines, add-WALL-WL,--dynamic-linker=/system/bin/linker
compile=$ (CC) $ (cflags) $ (cppflags) $ (ldflags)-wall-wl,--Dynamic-linker=/system/bin/linker
5. Edit Src/makefile Solve no bk.ver problem
Compiling with ARM-LINUX-GCC, encountering errors
MAKE[2]: * * * No rule to make target '. /sccs/s.changeset ', needed by
' Bk.ver '. Stop.
Solution:
$vim Src/makefile
231 $O/lmbench:. /scripts/lmbench Bk.ver
Delete Bk.ver, make again, build all tools binaries under bin/arm-linux/, and execute on Android devices after successful compilation.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/