How to migrate Lmbench to Android

Source: Internet
Author: User
Tags linux

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.