blob: 245e4522c4c993b9fc438cfe08ef5ae4a97db388 [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
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08004On the emulator, use the new -bootchart <timeout> option to boot with bootcharting
5activated for <timeout> seconds.
6
7Otherwise, flash your device, and start it. Then create a file on the /data partition
8with a command like the following:
9
Yongqin Liua197ff12014-12-05 13:45:02 +080010 adb shell 'echo $TIMEOUT > /data/bootchart/start'
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080011
12Where the value of $TIMEOUT corresponds to the wanted bootcharted period in seconds;
13for example, to bootchart for 2 minutes, do:
14
Yongqin Liua197ff12014-12-05 13:45:02 +080015 adb shell 'echo 120 > /data/bootchart/start'
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080016
17Reboot your device, bootcharting will begin and stop after the period you gave.
18You can also stop the bootcharting at any moment by doing the following:
19
Yongqin Liua197ff12014-12-05 13:45:02 +080020 adb shell 'echo 1 > /data/bootchart/stop'
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080021
Yongqin Liua197ff12014-12-05 13:45:02 +080022Note that /data/bootchart/stop is deleted automatically by init at the end of the
23bootcharting. This is not the case of /data/bootchart/start, so don't forget to delete it
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080024when you're done collecting data:
25
Yongqin Liua197ff12014-12-05 13:45:02 +080026 adb shell rm /data/bootchart/start
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027
Yongqin Liua197ff12014-12-05 13:45:02 +080028The log files are placed in /data/bootchart/. You must run the script tools/grab-bootchart.sh
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080029which will use ADB to retrieve them and create a bootchart.tgz file that can be used with
30the bootchart parser/renderer, or even uploaded directly to the form located at:
31
32 http://www.bootchart.org/download.html
33
34NOTE: the bootchart.org webform doesn't seem to work at the moment, you can generate an
35 image on your machine by doing the following:
36
37 1/ download the sources from www.bootchart.org
38 2/ unpack them
39 3/ in the source directory, type 'ant' to build the bootchart program
40 4/ type 'java -jar bootchart.jar /path/to/bootchart.tgz
41
42technical note:
43
Yongqin Liua197ff12014-12-05 13:45:02 +080044This implementation of bootcharting does not use the 'bootchartd' script provided by
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080045www.bootchart.org, but a C re-implementation that is directly compiled into our init
46program.