summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hawkins2017-01-17 15:27:05 -0600
committerJames Hawkins2017-01-19 12:15:51 -0600
commitb7893e6fa4b3a3cff3963d357086275a57489097 (patch)
tree9ece0c391c3881be095bceafc64910fa9ddb9f46
parent00d5dad56ff30102fa270832981a837b2f28155c (diff)
downloadplatform-system-core-b7893e6fa4b3a3cff3963d357086275a57489097.tar.gz
platform-system-core-b7893e6fa4b3a3cff3963d357086275a57489097.tar.xz
platform-system-core-b7893e6fa4b3a3cff3963d357086275a57489097.zip
bootstat: Fix false metrics due to soft reboots.
Use a flag to enable/disable logging metrics, set to false during soft reboots. Bug: 32807863 Change-Id: Ib1359327af4e18d40400c29961c454f7be1b8d0c Test: None (cherry picked from commit 800ceb45b15c2b63edd4c699862653c55fe55ef2)
-rw-r--r--bootstat/bootstat.rc20
1 files changed, 19 insertions, 1 deletions
diff --git a/bootstat/bootstat.rc b/bootstat/bootstat.rc
index c96e996f5..ca8bea22e 100644
--- a/bootstat/bootstat.rc
+++ b/bootstat/bootstat.rc
@@ -11,8 +11,26 @@ on post-fs-data
11on post-fs-data && property:init.svc.bootanim=running 11on post-fs-data && property:init.svc.bootanim=running
12 exec - root root -- /system/bin/bootstat -r post_decrypt_time_elapsed 12 exec - root root -- /system/bin/bootstat -r post_decrypt_time_elapsed
13 13
14# sys.logbootcomplete is a signal to enable the bootstat logging mechanism.
15# This signaling is necessary to prevent logging boot metrics after a soft
16# reboot (e.g., adb shell stop && adb shell start). /proc/uptime is not reset
17# during a soft reboot, which leads to false boot time metrics being reported.
18#
19# The 'on boot' event occurs once per hard boot (device power on), which
20# switches the flag on. If the device performs a soft reboot, the flag is
21# switched off and cannot be switched on until the device hard boots again.
22
23# Enable bootstat logging on boot.
24on boot
25 setprop sys.logbootcomplete 1
26
27# Disable further bootstat logging on a soft reboot. A soft reboot is
28# signaled by the zygote stopping.
29on property:init.svc.zygote=stopping
30 setprop sys.logbootcomplete 0
31
14# Record boot complete metrics. 32# Record boot complete metrics.
15on property:sys.boot_completed=1 33on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
16 # Record boot_complete and related stats (decryption, etc). 34 # Record boot_complete and related stats (decryption, etc).
17 exec - root root -- /system/bin/bootstat --record_boot_complete 35 exec - root root -- /system/bin/bootstat --record_boot_complete
18 36