To make parsing easier for last reboot reason. This also ensures that
last boot reason matches the content that is typically returned by the
bootloader or in turn landed in the canonical system boot reason.
Simplify parsing in bootstat. Adjust and fix boot_reason_test.sh for
new reality. Allow boot reason tests battery and kernel_panic to pass
if device does not support pstore (empty before and after the test).
If device somehow landed in fastboot mode while waiting for the
display, issue a fastboot reboot to move the test along. Some cleanup
and standardization changes to the test script.
Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: I97d5467c0b4a6d65df3525f1a2d0051db813d5ad
Change HandleSigtermSignal() handler to report shutdown,container. Add
the new reason to bootstat. Remove log stutter as
HandlPowerctlMessage will also do a LOG(INFO) reporting
shutdown,container as reason.
Sending SIGTERM to init is to allow a host OS to ask an Android
Container instance to shutdown. The temptation is to report
shutdown,sigterm but that does not accurately describe the usage
scenario.
Test: compile
Bug: 63736262
Change-Id: I3c5798921bdbef5d2689ad22a2e8103741b570b4
Establish a tighter trust relationship with digitization of the
battery level. Validate the reboot reason collected from the last
kmsg. Validate the last reboot reason before using for enhancing
system reboot reason.
Test: system/core/bootstat/boot_reason_test.sh
Bug: 63636262
Change-Id: I45fbac4a33c09295cda89de3b73c93a884033e3b
Code style has drifted too far from our current clang-format
settings.
Test: compile
Side-Effects: none
Bug: 63736262
Change-Id: Ie390459db123cfadf09aa06c8dafb1ae69a72af8
If bootloader reports kernel_panic, gives us permission for a
deeper check of which kind occurred. Resolve a problem with
some kernels that do not have the 'sysrq: SysRq :' log stutter.
Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: Idb8978de7a4f4e3c671c6ab7efc5ebe841f7bbd8
If the bootloader insists on reporting reboot for cold, warm and
hard, we need to reconstruct canonical reason from the
persist.sys.boot.reason property.
Some log lines contained bootstate, letting their noise through
during testing, changed regex to look for bootstat[^e].
Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: I3788c6cf8aca7fc73dd01bf95acb596d18ed7ee4
For reboot [reboot_arg] requests via either reboot or adb reboot,
if reboot_arg is empty then report "shell" or "adb" respectively.
Test: boot_reason_test.sh shell_reboot adb_reboot
Bug: 63736262
Change-Id: Ie613d9e62db6a705885e4e7520aede27af3aa1b9
Adding functionality to bootstat --record_boot_complete and
--record_boot_reason to initialize sys.boot.reason, the canonical
system boot reason.
Filter out ro.boot.bootreason oem noise into sys.boot.reason. Add
heuristics to determine what the boot reason is, when otherwise would
be defaulting to the blunt and relatively devoid of detail catch-all
reboot reasons ("reboot", "shutdown", "cold", "warm", "hard").
boot_reason_test.sh is also a compliance test.
Test: boot_reason_test.sh all
Bug: 63736262
Change-Id: Ic9a42cccbcfc89a5c0e081ba66d577a97c8c8c76
add description about --record_boot_complete in the help
Test: manually with HiKey
Change-Id: I521d6f5b9d98113c006fc6ab146b6c353ce2390c
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Use this for bootstat and init. This replaces the custom uptime parser in
bootstat.
This is a reland of aosp/338325 with a stubbed implementation for Darwin.
This change also has clang_format fixes (automatic).
Bug: 34352037
Test: chrono_utils_test
Change-Id: I72a62a3ca1ccfc0a4ccc6294ff1776c263144686
Use this for bootstat and init. This replaces the custom uptime parser in
bootstat.
This is a reland of aosp/332854 with a fix for Darwin.
Bug: 34352037
Test: chrono_utils_test
Change-Id: Ib2567d8df0e460ab59753ac1c053dd7f9f1008a7
bootstat.
To be shared with other native components that want to log histograms.
Bug: 34456830
Test: libmetricslogger_test
Change-Id: I94a1a91c6d33e443d66bc480158dc2470d6c9031
* Nanosecond precision ended up being harder to grok.
* This change modifies the Timer class to have duration_ms instead of
duration_ns.
Bug: 34466121
Test: adb logcat | grep bootstat
Change-Id: Ibd1c27dc3cb29d838a956e342281b2fb98d752a6
Should use android/log.h instead of log/log.h as a good example
to all others. Adjust header order to comply with Android Coding
standards.
Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
In rare cases the hardware storage on the device may be hosed and return
garbage. Use ParseInt which handles bad input instead of stoi.
BUG: 29334139
Change-Id: I91aedc169df110bea8097775f73dda11def22311
* Also log to the BootEventRecordStore to check lossiness.
* Log factory_reset_current_time_failure separately.
Bug: 27550578
Change-Id: Id3d579a74a59ac28290cb7d6048765519f9ba59b
This change introduces new metrics to discern boot time on encrypted devices:
* post_decrypt_time_elapsed
* boot_decryption_complete
* boot_complete_post_decrypt
* boot_complete_no_encryption
Bug: 27497357
Change-Id: I8d3a411029bd6a45f80589ff67c408593e133a87
The bootstat command enables the measurement and logging of boot time
metrics
for GMS devices.
BUG:21724738
Change-Id: I331456dd38a60fb4ef24a4d5320909dbad30db66