• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    Android手機系統的性能測試工具

    發布: 2011-1-25 10:29 | 作者: 網絡轉載 | 來源: 領測軟件測試網采編 | 查看: 529次 | 進入軟件測試論壇討論

    領測軟件測試網

    Android手機系統的性能測試工具

      Android應用的性能如何測試?JAVA層面可以用TraceView,可是用NDK開發出來的是so,TraceView跟蹤不了怎么辦?問了Google大神,答案是OProfile!

      Oprofile 是Linux系統下一個低開銷的系統全局的性能監視工具,利用處理器上所包含的專用的性能監視硬件(若沒有性能監視硬件則使用一個基于計時器的代用品)來收集與性能相關的數據樣品。它獲得關于內核以及系統上的可執行文件的信息,例如內存是何時被引用的;L2緩存請求的數量;收到的硬件中斷數量等。

      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-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

      用到的庫如下:

      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

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/

    TAG: Android android 手機系統

    31/3123>

    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>