/*********************************************************************** * lmbench andlmbench 移植测试 * 说明: * 想要移植一下lmbench性能测试软件对Android系统性能进行测试,但发现 * Android的Linux shell命令太少了,总是出错,下次要先移植busybox,并先 * 创建好软链接。 * * 2016-8-3 深圳 南山平山村 曾剑锋 **********************************************************************/ 一、下载andlmbench https://github.com/shizkr/andlmbench 二、编译: ./remmm.sh /home/zengjf/cmd/andlmbench-master 三、运行: 1. 查看怎么运行(andlmbench-master/scripts/Android.mk): ifeq ($(BUILD_LMBENCH),true) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := runlmbench LOCAL_SRC_FILES := $(LOCAL_MODULE) LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_MODULE_TAGS := eng LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) include $(BUILD_PREBUILT) 2. 于是可以看出: 最终的可执行程序是runlmbench 四、错误: 1. error1: 1. 现象: [email protected]:/ # runlmbench /system/bin/runlmbench[393]: which: not found ERROR: dd doesn‘t exist to run lmbench tool!!! 2. 原因(cat runlmbench): verifytools() { for tool in $1 do valid=$(which $tool | grep "" -c) if [ "$valid" != "1" ]; then echo "ERROR: $tool doesn‘t exist to run lmbench tool!!!" exit 1 fi done } 3. 测试which命令不存在: [email protected]:/ # which dd /system/bin/sh: which: not found [email protected]:/ # 4. 测试busybox which命令是否存在: [email protected]:/ # busybox which BusyBox v1.15.3 (2011-11-25 17:55:55 CST) multi-call binary Usage: which [COMMAND]... Locate a COMMAND [email protected]:/ # 2. error2: 1. 现象: [email protected]:/ # runlmbench ERROR: sed doesn‘t exist to run lmbench tool!!! 2. 测试sed命令: [email protected]:/ # sed /system/bin/sh: sed: not found 3. 原因: 本套Android系统中没有完整的Linux shell命令,可能要考虑使用busybox重新生成软链接才行。
时间: 2024-10-10 17:38:02