Skip to content

Commit 53684ea

Browse files
bootstat: Record the time since factory reset on init.
Bug: 25448351 Change-Id: I71905a598e74f41c18a96d469c7a6ddd5a2e07fb
1 parent 72d6269 commit 53684ea

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: bootstat/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ analysis.
1212
-p, --print Dump the boot event records to the console
1313
-r, --record Record the timestamp of a named boot event
1414
--record_boot_reason Record the reason why the device booted
15+
--record_time_since_factory_reset Record the time since the device was reset
1516

1617
## Relative time ##
1718

Diff for: bootstat/bootstat.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ void ShowHelp(const char *cmd) {
8080
" -l, --log Log all metrics to logstorage\n"
8181
" -p, --print Dump the boot event records to the console\n"
8282
" -r, --record Record the timestamp of a named boot event\n"
83-
" --record_boot_reason Record the reason why the device booted\n");
83+
" --record_boot_reason Record the reason why the device booted\n"
84+
" --record_time_since_factory_reset Record the time since the device was reset\n");
8485
}
8586

8687
// Constructs a readable, printable string from the givencommand line
@@ -192,7 +193,7 @@ int main(int argc, char **argv) {
192193

193194
int option_index = 0;
194195
static const char boot_reason_str[] = "record_boot_reason";
195-
static const char factory_reset_str[] = "record_factory_reset";
196+
static const char factory_reset_str[] = "record_time_since_factory_reset";
196197
static const struct option long_options[] = {
197198
{ "help", no_argument, NULL, 'h' },
198199
{ "log", no_argument, NULL, 'l' },

Diff for: bootstat/bootstat.rc

+3
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ on property:init.svc.bootanim=stopped
1313
# Record the boot reason.
1414
exec - root root -- /system/bin/bootstat --record_boot_reason
1515

16+
# Record time since factory reset.
17+
exec - root root -- /system/bin/bootstat --record_time_since_factory_reset
18+
1619
# Log all boot events.
1720
exec - root root -- /system/bin/bootstat -l

0 commit comments

Comments
 (0)