diff options
author | James Hawkins <jhawkins@google.com> | 2016-02-23 16:18:19 -0800 |
---|---|---|
committer | James Hawkins <jhawkins@google.com> | 2016-02-24 11:01:03 -0800 |
commit | 53684ea625b9cff34f9cdb2d4bae4cd25538ca3b (patch) | |
tree | c7ebe4d311d771e409bcb1cbccfd44c58e189057 /bootstat | |
parent | 72d6269b6efda3e43a119de048b87758ff970184 (diff) | |
download | core-53684ea625b9cff34f9cdb2d4bae4cd25538ca3b.tar.gz core-53684ea625b9cff34f9cdb2d4bae4cd25538ca3b.tar.bz2 core-53684ea625b9cff34f9cdb2d4bae4cd25538ca3b.zip |
bootstat: Record the time since factory reset on init.
Bug: 25448351
Change-Id: I71905a598e74f41c18a96d469c7a6ddd5a2e07fb
Diffstat (limited to 'bootstat')
-rw-r--r-- | bootstat/README.md | 1 | ||||
-rw-r--r-- | bootstat/bootstat.cpp | 5 | ||||
-rw-r--r-- | bootstat/bootstat.rc | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/bootstat/README.md b/bootstat/README.md index b3964ce1c..76ea6c1e3 100644 --- a/bootstat/README.md +++ b/bootstat/README.md @@ -12,6 +12,7 @@ analysis. -p, --print Dump the boot event records to the console -r, --record Record the timestamp of a named boot event --record_boot_reason Record the reason why the device booted + --record_time_since_factory_reset Record the time since the device was reset ## Relative time ## diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 0c49f8217..c199190eb 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -80,7 +80,8 @@ void ShowHelp(const char *cmd) { " -l, --log Log all metrics to logstorage\n" " -p, --print Dump the boot event records to the console\n" " -r, --record Record the timestamp of a named boot event\n" - " --record_boot_reason Record the reason why the device booted\n"); + " --record_boot_reason Record the reason why the device booted\n" + " --record_time_since_factory_reset Record the time since the device was reset\n"); } // Constructs a readable, printable string from the givencommand line @@ -192,7 +193,7 @@ int main(int argc, char **argv) { int option_index = 0; static const char boot_reason_str[] = "record_boot_reason"; - static const char factory_reset_str[] = "record_factory_reset"; + static const char factory_reset_str[] = "record_time_since_factory_reset"; static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "log", no_argument, NULL, 'l' }, diff --git a/bootstat/bootstat.rc b/bootstat/bootstat.rc index 218b9f8bb..13ef27ea0 100644 --- a/bootstat/bootstat.rc +++ b/bootstat/bootstat.rc @@ -13,5 +13,8 @@ on property:init.svc.bootanim=stopped # Record the boot reason. exec - root root -- /system/bin/bootstat --record_boot_reason + # Record time since factory reset. + exec - root root -- /system/bin/bootstat --record_time_since_factory_reset + # Log all boot events. exec - root root -- /system/bin/bootstat -l |