bootstat: Record the time since factory reset on init.

Bug: 25448351
Change-Id: I71905a598e74f41c18a96d469c7a6ddd5a2e07fb
This commit is contained in:
James Hawkins 2016-02-23 16:18:19 -08:00
parent 72d6269b6e
commit 53684ea625
3 changed files with 7 additions and 2 deletions

View File

@ -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 ##

View File

@ -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' },

View File

@ -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