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