Improve init bootcharting.
Most notably, there's no longer any need to guess an end time.
Bug: http://b/23478578
Bug: http://b/33450491
Test: rebooted with bootcharting on/off
Change-Id: Icb7d6859581da5526d77dfc5aa4d57c9bfbfd7e2
diff --git a/init/readme.txt b/init/readme.txt
index 7549e3c..7f2bb53 100644
--- a/init/readme.txt
+++ b/init/readme.txt
@@ -256,9 +256,10 @@
Commands
--------
-bootchart_init
- Start bootcharting if configured (see below).
- This is included in the default init.rc.
+bootchart [start|stop]
+ Start/stop bootcharting. These are present in the default init.rc files,
+ but bootcharting is only active if the file /data/bootchart/enabled exists;
+ otherwise bootchart start/stop are no-ops.
chmod <octal-mode> <path>
Change file access permissions.
@@ -471,19 +472,11 @@
On the emulator, use the -bootchart <timeout> option to boot with bootcharting
activated for <timeout> seconds.
-On a device, create /data/bootchart/start with a command like the following:
+On a device:
- adb shell 'echo $TIMEOUT > /data/bootchart/start'
+ adb shell 'touch /data/bootchart/enabled'
-Where the value of $TIMEOUT corresponds to the desired bootcharted period in
-seconds. Bootcharting will stop after that many seconds have elapsed.
-You can also stop the bootcharting at any moment by doing the following:
-
- adb shell 'echo 1 > /data/bootchart/stop'
-
-Note that /data/bootchart/stop is deleted automatically by init at the end of
-the bootcharting. This is not the case with /data/bootchart/start, so don't
-forget to delete it when you're done collecting data.
+Don't forget to delete this file when you're done collecting data!
The log files are written to /data/bootchart/. A script is provided to
retrieve them and create a bootchart.tgz file that can be used with the