blob: 70cf2c39bca288346c5e49d55401e609b00a02a4 [file] [log] [blame]
The Android Open Source Project35237d12008-12-17 18:08:08 -08001This version of init contains code to perform "bootcharting", i.e. generating log
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -07002files that can be later processed by the tools provided by www.bootchart.org.
3
The Android Open Source Project35237d12008-12-17 18:08:08 -08004To activate it, you need to define build 'init' with the INIT_BOOTCHART environment
5variable defined to 'true', for example:
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -07006
The Android Open Source Project35237d12008-12-17 18:08:08 -08007 touch system/init/init.c
8 m INIT_BOOTCHART=true
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -07009
The Android Open Source Project35237d12008-12-17 18:08:08 -080010On the emulator, use the new -bootchart <timeout> option to boot with bootcharting
11activated for <timeout> seconds.
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070012
The Android Open Source Project35237d12008-12-17 18:08:08 -080013Otherwise, 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:
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070025
26 adb shell 'echo 1 > /data/bootchart-stop'
27
The Android Open Source Project35237d12008-12-17 18:08:08 -080028Note 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
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070030when you're done collecting data:
31
The Android Open Source Project35237d12008-12-17 18:08:08 -080032 adb shell rm /data/bootchart-start
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070033
The Android Open Source Project35237d12008-12-17 18:08:08 -080034The log files are placed in /data/bootchart/. you must run the script tools/grab-bootchart.sh
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070035which 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
The Android Open Source Project35237d12008-12-17 18:08:08 -080040NOTE: 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
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070048technical 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.