blob: 70cf2c39bca288346c5e49d55401e609b00a02a4 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001This version of init contains code to perform "bootcharting", i.e. generating log
2files that can be later processed by the tools provided by www.bootchart.org.
3
4To activate it, you need to define build 'init' with the INIT_BOOTCHART environment
5variable defined to 'true', for example:
6
7 touch system/init/init.c
8 m INIT_BOOTCHART=true
9
10On the emulator, use the new -bootchart <timeout> option to boot with bootcharting
11activated for <timeout> seconds.
12
13Otherwise, flash your device, and start it. Then create a file on the /data partition
14with a command like the following:
15
16 adb shell 'echo $TIMEOUT > /data/bootchart-start'
17
18Where the value of $TIMEOUT corresponds to the wanted bootcharted period in seconds;
19for example, to bootchart for 2 minutes, do:
20
21 adb shell 'echo 120 > /data/bootchart-start'
22
23Reboot your device, bootcharting will begin and stop after the period you gave.
24You can also stop the bootcharting at any moment by doing the following:
25
26 adb shell 'echo 1 > /data/bootchart-stop'
27
28Note that /data/bootchart-stop is deleted automatically by init at the end of the
29bootcharting. This is not the case of /data/bootchart-start, so don't forget to delete it
30when you're done collecting data:
31
32 adb shell rm /data/bootchart-start
33
34The log files are placed in /data/bootchart/. you must run the script tools/grab-bootchart.sh
35which will use ADB to retrieve them and create a bootchart.tgz file that can be used with
36the bootchart parser/renderer, or even uploaded directly to the form located at:
37
38 http://www.bootchart.org/download.html
39
40NOTE: the bootchart.org webform doesn't seem to work at the moment, you can generate an
41 image on your machine by doing the following:
42
43 1/ download the sources from www.bootchart.org
44 2/ unpack them
45 3/ in the source directory, type 'ant' to build the bootchart program
46 4/ type 'java -jar bootchart.jar /path/to/bootchart.tgz
47
48technical note:
49
50this implementation of bootcharting does use the 'bootchartd' script provided by
51www.bootchart.org, but a C re-implementation that is directly compiled into our init
52program.