android 手机性能测试工具,Android手机系统的性能测试工具

Android手机系统的

Android应用的性能如何测试?JAVA层面可以用TraceView,可是用NDK

Oprofile 是

Oprofile的特点如下:

l 无需重新编译源代码,如果不进行源代码及分析,连调试信息(-g option to gcc)也不是必须的。

l 只在内核中插入一个模块。

l 可以分析运行于系统之上的所有代码(禁用中断的代码除外)

l 系统的额外开销小,Oprofile会增加1%-8%的系统开销(取决于采样频率)

l 兼容所有2.2,2.4,2.6内核,可以运行在SMP系统之上

l 支持主流CPU架构,包括X86、arm、AVR32、mips、powerpc等

Oprofile要想跑在Andorid上,要满足下面的条件:

1.内核要支持

2.要将Oprofile移植到Arm平台上

下面是移植的全过程:

一、Oprofile移植

用到的交叉编译工具如下:

arm-2010.09-50-arm-none-

用到的库如下:

popt-1.14.tar.gz

binutils-2.21.tar.gz

oprofile-0.9.6.tar.gz

$ tar xvfz arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C ~/

修改~/.bashrc,添加

export PATH=${PATH}:/home/louieli/arm-2010.09/bin

$ tar zxvf popt-1.14.tar.gz

$ cd popt-1.14

$ ac_cv_va_copy=yes ./configure --with-kernel-support --host=arm-none-linux-gnueabi --prefix=/home/louieli/work/popt

$ make

$ make install

$ tar zxvf binutils-2.21.tar.gz

$ cd binutils-2.21/

$ ./configure --with-kernel-support --host=arm-none-linux-gnueabi --prefix=/home/louieli/work/binutils --enable-shared

$ make LDFLAGS="-all-static"

可能会出现 cc1: warnings being treated as errors,找到出错文件的Makefile文件,将-Werror去掉

$ make install

$ tar zxvf oprofile-0.9.6.tar.gz

$ cd oprofile-0.9.6/

$ ./configure --with-kernel-support --host=arm-none-linux-gnueabi --prefix=/home/louieli/work/oprofile/ --with-extra-libs=/home/louieli/work/popt/lib/ --with-extra-includes=/home/louieli/work/popt/include/ --with-binutils=/home/louieli/work/binutils

$ make LDFLAGS="-all-static -L/home/louieli/work/binutils/lib -Xlinker -R -Xlinker /home/louieli/work/binutils/lib -L/home/louieli/work/popt/lib/"

$ make install

用file 命令查看,我们需要的oprofile文件都已经变成可以在android上跑的静态链接文件了

install.sh: Bourne-Again shell script text executable

opannotate: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

oparchive: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

opcontrol: a /system/bin/sh script text executable

opgprof: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

ophelp: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

opimport: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

opjitconv: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

opreport: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

oprofiled: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

论坛精华帖

31/3123>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值