1. PC tools
$ sudo apt-get install bootchart
$ sudo apt-get install pybootchartgui
2.Rebuild Android
//modify system/core/init/bootchart.h
#ifndef BOOTCHART
#define BOOTCHART 1 //"1"means enable
#endif
$export INIT_BOOTCHART=true
#Make sure the flag will NOT be overrided
#and then recompile init.
#mmm system/core/
$make bootimage
#Then flash the image and reboot
3.Config the bootchart
# config duration
$ adb shell 'echo 120 > /data/bootchart-start'
#config saved file path
$ adb shell 'mkdir /data/bootchart'
4. reboot
5. parse data
#pull the bootchart log from /data/bootchart
system/core/init/grab-bootchart.sh
#export as a png
$bootchart ./bootchart.tgz