Bootchart is a system designed to show a graphical display of the activity of a system during boot.
。。。
Omit the official profile, here is the relevant connection:
http://www.elinux.org/Using_Bootchart_on_Android;
http://www.bootchart.org/;
1. Installing the Bootchart tool installation tools
sudo apt-get install Bootchart
2. Building ' init ' with Bootchart support recompile init
The entire project can be recompiled
$ cd mydroid$ export init_bootchart=true$ make clean$ make
or compile the init module separately
$ touch system/core/init/init.c $ M init_bootchart=true
3. Installing ' init ' into your system image reload init module
Restart the machine or ADB push to the Android console, pay attention to change the permissions;
ADB push Out/target/product/generic/root/init/init
4. Triggering Bootchart functionality on system boot enable Bootchart tool
adb shell ' echo >/data/bootchart-start '
5. Retrieving the collected data from the system
Bootchart generated Data under the/data/bootchart file
Can be copied and packaged using Bootchart's own script grab-bootchart.sh, or you can do your own adb pull to the Ubuntu machine for packaging;
6. Generating the graphic from the data to generate PNG images
$bootchart./bootchart.tgz
After the command is executed, the error prompt is generated directly:
parsing ' header ' parsing ' Proc_stat.log ' parsing ' Proc_ps.log ' warning: no parent for pid ' 2 ' with ppid ' 0 ' parsing ' Proc_diskstats.log ' parsing ' Kernel_pacct ' merged 0 logger processes pruned 63 process, 0 exploders, 2 threads, and 0 runs False Traceback (Most recent call last): file "/usr/bin/bootchart", line 23, in <module> sys.exit (Main ()) file "/usr/lib/pymodules/python2.6/pybootchartgui/main.py", line 137, in main render () File "/usr/lib/pymodules/python2.6/pybootchartgui/main.py ", line 128, in render batch.render (Writer, res, options, filename) File "/usr/lib/pymodules/python2.6/pybootchartgui/batch.py", line 41, in render draw.render (ctx, options, *res) File "/usr /lib/pymodules/python2.6/pybootchartgui/draw.py ", line 282, in render &nBsp; draw_chart (ctx, io_color, true, chart_rect, [( Sample.time, sample.util) for sample in disk_stats], proc_tree) File "/usr/lib/pymodules/python2.6/ pybootchartgui/draw.py ", line 201, in draw_chart yscale = float (Chart_bounds[3]) / max (y for (x, y) in data ZeroDivisionError: float Division
This error is caused by the Python version, and the following modifications can fix the problem: Modify the draw.py,parsing.py,samples.py three files under the/usr/share/pyshared/pybootchartgui/directory:
draw.py
Put 200,201 lines by: XScale = float (chart_bounds[2])/MAX (x for (y) in data) Yscale = float (chart_bounds[3])/MAX (Y F or (x, y) in data) to: XScale = float (chart_bounds[2])/MAX (0.00001, Max (x for (y) in data) Yscale = Flo At (Chart_bounds[3])/MAX (0.00001, Max (Y for (x, y) in data)
parsing.py
Add after 156 lines: if interval = = 0:interval = 1 modified as follows: sums = [A-B for a, B. in Zip (Sample1.diskdata, Sample2 . Diskdata)] if interval = = 0:interval = 1
samples.py
Add after 81 lines: if interval = = 0:interval = 1 modified as follows: Def calc_load (self, usercpu, syscpu, interval): If I Nterval = = 0: <br> interval = 1
execute again, and you can build it smoothly bootchart.png File
$bootchart./bootchart.tgz
The resulting PNG file resembles the following:
Reference article:
http://blog.csdn.net/harry_helei/article/details/8545032
Application of using Bootchart on Android in power-on measurement