BootChart在Android中使用


1 简介

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

2 BootChart使用步骤

(1)在主机上安装BootChart;

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

$sudo apt-get install bootchart。

(2)建立支持BootChart的init文件;

$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是采集时间,www.bkjia.com可以根据需要调整。

(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)结果分析。

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

相关内容