2016-01-22 07:16:36 +08:00
|
|
|
# This file is the LOCAL_INIT_RC file for the bootstat command.
|
|
|
|
|
|
|
|
on post-fs-data
|
|
|
|
mkdir /data/misc/bootstat 0700 root root
|
|
|
|
|
2016-03-12 06:59:50 +08:00
|
|
|
# Record the time at which the user has successfully entered the pin to decrypt
|
|
|
|
# the device, /data is decrypted, and the system is entering the main boot phase.
|
|
|
|
#
|
|
|
|
# post-fs-data: /data is writable
|
|
|
|
# property:init.svc.bootanim=running: The boot animation is running
|
2017-02-10 01:58:14 +08:00
|
|
|
# property:ro.crypto.type=block: FDE device
|
|
|
|
on post-fs-data && property:init.svc.bootanim=running && property:ro.crypto.type=block
|
2016-03-12 06:59:50 +08:00
|
|
|
exec - root root -- /system/bin/bootstat -r post_decrypt_time_elapsed
|
|
|
|
|
2017-01-18 05:27:05 +08:00
|
|
|
# sys.logbootcomplete is a signal to enable the bootstat logging mechanism.
|
2017-02-01 03:52:48 +08:00
|
|
|
# This signaling is necessary to prevent logging boot metrics after a runtime
|
|
|
|
# restart (e.g., adb shell stop && adb shell start). /proc/uptime is not reset
|
|
|
|
# during a runtime restart, which leads to false boot time metrics being reported.
|
2017-01-18 05:27:05 +08:00
|
|
|
#
|
|
|
|
# The 'on boot' event occurs once per hard boot (device power on), which
|
2017-02-01 03:52:48 +08:00
|
|
|
# switches the flag on. If the device performs a runtime restart, the flag is
|
2017-01-18 05:27:05 +08:00
|
|
|
# switched off and cannot be switched on until the device hard boots again.
|
|
|
|
|
|
|
|
# Enable bootstat logging on boot.
|
|
|
|
on boot
|
|
|
|
setprop sys.logbootcomplete 1
|
|
|
|
|
2017-02-01 03:52:48 +08:00
|
|
|
# Disable further bootstat logging on a runtime restart. A runtime restart is
|
2017-01-18 05:27:05 +08:00
|
|
|
# signaled by the zygote stopping.
|
|
|
|
on property:init.svc.zygote=stopping
|
|
|
|
setprop sys.logbootcomplete 0
|
|
|
|
|
2016-12-02 06:02:17 +08:00
|
|
|
# Record boot complete metrics.
|
2017-01-18 05:27:05 +08:00
|
|
|
on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
|
2016-03-12 06:59:50 +08:00
|
|
|
# Record boot_complete and related stats (decryption, etc).
|
|
|
|
exec - root root -- /system/bin/bootstat --record_boot_complete
|
2016-01-22 07:16:36 +08:00
|
|
|
|
2016-02-10 07:32:38 +08:00
|
|
|
# Record the boot reason.
|
|
|
|
exec - root root -- /system/bin/bootstat --record_boot_reason
|
|
|
|
|
2016-02-24 08:18:19 +08:00
|
|
|
# Record time since factory reset.
|
|
|
|
exec - root root -- /system/bin/bootstat --record_time_since_factory_reset
|
|
|
|
|
2016-01-22 07:16:36 +08:00
|
|
|
# Log all boot events.
|
|
|
|
exec - root root -- /system/bin/bootstat -l
|