现在的位置: 首页 > 综合 > 正文

BootChart在Android中使用

2013年10月06日 ⁄ 综合 ⁄ 共 838字 ⁄ 字号 评论关闭

       BootChartAndroid中使用

       1 简介

              BootChart是一个对Linux boot过程进行性能分析并把结果直观化的工具。BootChart包含数据收集和图像产生工具,Android中,数据收集工具被继承到了init程序中。

       2 BootChart使用步骤

1)在主机上安装BootChart

       主机是ubuntu,在主机上安装BootChart

       $sudo apt-get install bootchart

2)建立支持BootChartinit文件;

       $touch system/core/init/init.c

       $m INIT_BOOTCHART=true

       将生成更新的ramdisk.img

3)安装init到手机系统;

       ramdisk.img烧写到手机。

4)启动BootChart功能;

       adb shell ‘echo 120 > /data/bootchart-start’   其中120是采集时间,可以根据需要调整。

5)收集系统产生的数据;

       重启机器,数据会自动收集到/data/bootchart目录中

head,kernel_pacct,proc_diskstats.log,proc_ps.log,proc_stat.log

       adb pull /data/bootchart ./tmp目录,进入tmp目录 tar czf bootchart.tgz *  

6)根据数据产生图表;

       $ bootchart bootchart.tgz生成图表。

7)结果分析。

       图表上部为CPUdisk的使用情况,从左到右是时间轴,下方是各进程的运行状态条,显示各进程的开始时间和结束时间以及对应cpuI/O利用情况。

参考文献

http://elinux.org/Using_Bootchart_on_Android

抱歉!评论已关闭.