summaryrefslogtreecommitdiffstats
path: root/bootstat
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "bootstat: add support for regex in aliasReasons and powerkeys" am: ↵Mark Salyzyn2018-03-172-20/+26
|\| | | | | | | | | | | | | | | | | | | | | | | f4be06450a am: 4134f4c701 Change-Id: Iaf9c670ed74aa395455252bfda9a2b3933654d11
| * | bootstat: add support for regex in aliasReasons and powerkeysMark Salyzyn2018-03-162-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for regex in aliasReasons for the alias member. Use this new feature to check powerkey|power_key|PowerKey for a single entry. Test: boot_reason_test.sh Bug: 63736262 Change-Id: Ia6add99b9e33f3197643dbaab88dde20aa726f90
* | | Merge "bootstat: alias underline to space in bit error rate handling" am: ↵Mark Salyzyn2018-03-161-17/+23
|\| | | | | | | | | | | | | | | | | | | | | | | 40858e95b6 am: ee3c8e64dc Change-Id: I9f25ad71f8abfbd39c9a0055e2c96c9024224eca
| * | bootstat: alias underline to space in bit error rate handlingMark Salyzyn2018-03-161-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are matching existing known boot reasons, we should try with compliant underlines first, then again with underlines replaced with spaces. Replace references to Ber with BitError for maintenance clarity. Replace helper functions with C++11 lambdas. Test: boot_reason_test.sh Bug: 63736262 Change-Id: I91b865013513526a55a85523080c7127f198968c
* | | Merge "bootstat: comment out duplicate entries in kBootReasonMap" am: 1408ceec4fMark Salyzyn2018-03-161-3/+3
|\| | | | | | | | | | | | | | | | | am: 07e4e9b5fc Change-Id: If9f7c72d286b926253602f141245ccf9385e23d4
| * | bootstat: comment out duplicate entries in kBootReasonMapMark Salyzyn2018-03-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two entries can be reused. The third "unknown" entry is not really a duplicate since the kUnknownBootReason is not checked. Duplicate entries reused in the future, should have analysis/uma/configs/clearcut/TRON/histograms.xml updated first. Test: boot_reason_test.sh Change-Id: If2071a18160dc2c93e851fecc6b8c11fc76c9845
* | | Merge "bootstat: 3.18 kernel does not report "SysRq : Trigger a crash"" am: ↵Mark Salyzyn2018-03-161-3/+7
|\| | | | | | | | | | | | | | | | | | | | | | | 5e2b2681ef am: a2b4750771 Change-Id: Id6dc67787ae80e7ca043258cc7dd8e498f8fe0c5
| * | bootstat: 3.18 kernel does not report "SysRq : Trigger a crash"Mark Salyzyn2018-03-161-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use an alternate means to determine that the sysrq crash was requested. Also, to be CTS compliant, the kernel_panic subreason must be in lower case. Test: boot_reason_test.sh Bug: 74595769 Bug: 63736262 Change-Id: Ica06960ce62d220a909006e365951376d672b7e6
* | | Merge "bootstat: test: regression from "Fix perfomance degredation from ↵Mark Salyzyn2018-03-161-0/+1
|\| | | |/ |/| | | | | | | | | | | BootSequence atom"" am: 450b1afcb5 am: a6c1ddd262 Change-Id: I7a774ac1e0782cde687ca3d3202cf19653ad05c4
| * bootstat: test: regression from "Fix perfomance degredation from ↵Mark Salyzyn2018-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | BootSequence atom" Added --set_system_boot_reason to expected filter Test: boot_reason_test.sh Bug: 74595769 Bug: 63736262 Bug: 72864061 Change-Id: Ie912d097fb6468dd826fd9422758fb9fb3e1ee29
* | Merge "Fix PDK build" am: 24e34e4b8e am: 9a393de28fLogan Chien2018-02-141-0/+3
|\| | | | | | | | | | | am: 2dc1f072f2 Change-Id: Ib64a3307ff02481b4fff1500830f75e56eae5815
| * Fix PDK buildLogan Chien2018-02-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This commit disables "bootstat" in PDK builds because "bootstat" depends on "libstatslog" (from "frameworks/base") which is not included in PDK builds as well. Test: Build a target (described in http://b/72961456) with `platform.zip` built from master FSK source tree. Bug: 72961456 Change-Id: I06b1555694510e17ea82d5c6dfcdeaf99b905e4d
* | Fix performance degradation from BootSequence atomTej Singh2018-02-122-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the boot sequence reported atom in ag/3518079 caused the duration of bootstat to increase, as seen in b/72864061. I isolated the cause down to calling BootReasonStrToReason. However, this function also gets called in ReportBootReason, so I created another function that does the parsing and sets the system boot reason property, and made RecordBootReason and statsd logging get that property. Bug: 72864061 Test: rebooted phone, verified boot events were received in adb shell logcat -b stats and verified adb shell bootstat -p printed correct values. Ran timing tests as well on walleye with 20 boots: before this change, the average was ~150-160ms. After, it was ~80ms. Change-Id: I92dbc9880328835647be7d9d50c7861b42f27bdb
* | Merge "Atom: BootSequenceReported"TreeHugger Robot2018-01-312-10/+59
|\ \ | |/ |/|
| * Atom: BootSequenceReportedTej Singh2018-01-262-10/+59
| | | | | | | | | | | | | | | | | | | | | | | | Logs information about boot time and reason to statsd. Specifically: bootloader boot reason, system boot reason, bootloader boot time, total boot time, time that the boot finished, and time since last boot. Test: booted the phone and verified "adb logcat -b stats" received the event Change-Id: I769df9a09263ed3667f7085c81b3d072e868cbda
* | bootstat: Add more boot reasons.James Hawkins2018-01-261-0/+4
|/ | | | | | Bug: none Test: none Change-Id: I483e4e2c6ea4219ac21b64a24bfac58c2919a40b
* Merge "bootstat: Add more boot reasons."Treehugger Robot2018-01-091-0/+9
|\
| * bootstat: Add more boot reasons.James Hawkins2018-01-051-0/+9
| | | | | | | | | | | | | | | | These appear to be winding down... Bug: none Test: none Change-Id: I00bc84d8e50b1563f97f812f722aa6bdbd6265b2
* | Merge "Fix sanitizer errors in bootstat.cpp."Ivan Lozano2017-12-211-2/+4
|\ \
| * | Fix sanitizer errors in bootstat.cpp.Ivan Lozano2017-12-201-2/+4
| |/ | | | | | | | | | | | | | | | | | | | | Integer overflow sanitized builds are throwing an error on the while loop decrement in the rfind function. This refactors the loop to prevent decrementing the value on the final iteration. Test: Compiled and device boots without runtime error. Bug: 30969751 Change-Id: Ice4532cce933062b3c14adf2d9749cfdea4ad84c Merged-In: Ice4532cce933062b3c14adf2d9749cfdea4ad84c
* / Add std::string StartsWith*/EndsWith* overloads.Elliott Hughes2017-12-201-6/+3
|/ | | | | | | | | We should have done this from the beginning. Thanks to Windows, we're not going to be able to switch libbase over to std::string_view any time soon. Bug: N/A Test: ran tests Change-Id: Iff2f56986e39de53f3ac484415378af17dacf26b
* bootstat: Add tons of new boot reasons.James Hawkins2017-12-181-0/+26
| | | | | | Bug: none Test: none Change-Id: I57e89a20f23d3b3cff2fa6667e25f1c37cb2870c
* Merge "Add OWNERS."Elliott Hughes2017-12-071-0/+1
|\
| * Add OWNERS.Elliott Hughes2017-12-071-0/+1
| | | | | | | | | | | | Bug: N/A Test: N/A Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
* | bootstat: Add more boot reasons.James Hawkins2017-12-041-0/+4
| | | | | | | | | | | | Bug: none Test: none Change-Id: I4cc6e2e39b6c5954387006d48f2119211fa37dd5
* | bootstat: Add four more boot reasons.James Hawkins2017-11-301-0/+4
|/ | | | | | Bug: none Test: none Change-Id: Ifd62e3a8bb6142e89fcde819eab1caba3d7933b7
* bootstat: Three more boot reasons.James Hawkins2017-11-291-0/+3
| | | | | | Bug: none Test: none Change-Id: I37b6ed6ce73f403aa5f9db2c0234e9dc4c0f7c01
* Merge "bootstat: Add a few more bootreasons."James Hawkins2017-11-291-0/+7
|\
| * bootstat: Add a few more bootreasons.James Hawkins2017-11-281-0/+7
| | | | | | | | | | | | Bug: none Test: none Change-Id: I9b482e642a9eec26670118a265046194f3cc2a7a
* | bootstat: kernel_panic test w/o bootloader or pstore supportMark Salyzyn2017-11-201-1/+6
|/ | | | | | | | | | | | | | | | If the platform has no bootloader or pstore support, kernel_panic test should fail if the results are not correct. Drop skipping of failed test if pstore support is lacking. If device demonstrably has pstore content support, the result must be exacting kernel_panic,sysrq. Otherwise accept the less precise result. Test: On hikey960 (which currently lacks reliable pstore, or a compliant bootloader reporting bootreason), expect failure of: system/core/bootstat/boot_reason_test.sh kernel_panic Bug: 63736262 Change-Id: I071a2a9c00dc522ec037c8a8997fea524d17e6e4
* bootstat: Add another boot reason.James Hawkins2017-10-311-0/+1
| | | | | | Bug: None Test: None Change-Id: I865a12e9c8833c4a345284181aa1812be3eddadd
* bootstat: test: add error propagation for fastboot format userdataMark Salyzyn2017-10-271-1/+7
| | | | | | Test: system/core/bootstat/boot_reason_test.sh optional_factory_reset Bug: 63736262 Change-Id: I8893df15ef802bb76c0795288df91d8463bfe3d1
* bootstat: handle a bad bit error rate issue with pstoreMark Salyzyn2017-10-261-9/+137
| | | | | | | | | | | | | | | | | | | | | | | | Create a private rfind that allows a fuzzy match based on a bit error rate (BER) of 1 every 8 bits. last kmsg is affected by pstore ramoops backing that suffers from data corruption. Add some additional validation based on possible data corruption scenarios, as a noisy match means higher chance of noisy data. Noisy data notably can affect the battery level detection, but do not typically result in false positives. Battery level, or failure, is the responsibility of the BatteryStats service, providing a positive signal and strong device-independent algorithm. The checking done in bootstat is likely to be deprecated in favour of an API request to BatteryStats once their algorithms deal with surprise outages due to aging. The kernel logging heuristic and BER fixup handily deals with a prevalent issue where some bootloaders failure to properly notify us of panics. This is where the gains are noticed with this improvement. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I93b4210f12fb47c5c036f4d6eb4cafeee4896d35
* bootstat: better validation of battery level (shutdown,battery)Mark Salyzyn2017-10-261-6/+18
| | | | | | | | | | | Replace simple strtoull with loop that ensures no leading zeros. Restrict size of value buffer being checked as allocation was going to end of retrieved buffer, which can cause unnecessary memory pressure during boot. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: Ifdc1d4fd3a73794c001577024ce7cbfde9c25028
* bootstat: Do not allow unknown boot reasons to land in first field.Mark Salyzyn2017-10-261-1/+3
| | | | | | | | | If we sniff an unknown boot reason from last kmsg, make sure it has a "reboot," prefix. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: Ia1c401b8899d1f0c56bd4f5d8d2d19b7fc889a30
* bootstat: move boot reason validation transformation policy into subroutine.Mark Salyzyn2017-10-261-10/+12
| | | | | | | | | Allow for future policy adjustments. SideEffects: None Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I571fb7dafc6b80c75d2809a3da3f9b96784cef06
* bootstat: test: fix Its_Just_So_Hard_rebootMark Salyzyn2017-10-262-5/+20
| | | | | | | | | Add the test injection to known list, and deal with an error propagation issue. Test: system/core/bootstat/boot_reason_test.sh Its_Just_So_Hard_reboot Bug: 63736262 Change-Id: I4799956978a8884c69c830fcedd7febd143651fd
* bootstat: add shutdown,thermal,batteryMark Salyzyn2017-10-251-0/+1
| | | | | | Test: system/core/bootreason/boot_reason_test.sh Bug: 63736262 Change-Id: I30d6b5308fd8616eae31ad13e925d66c9fc07367
* bootstat: add reboot,2secMark Salyzyn2017-10-251-0/+2
| | | | | | Test: system/core/bootreason/boot_reason_test.sh Bug: 63736262 Change-Id: Ie2e5872adb14e0979ff87eb4d2f57ab2849facd4
* bootstat: test: check ro.boot.bootreason in some testsMark Salyzyn2017-10-251-0/+2
| | | | | | | | | blind_reboot_test() did not report the ro.boot.bootreason value, making it more difficult to diagnose failures. Test: system/core/bootstat/boot_reason_test.sh cold warm hard Bug: 63736262 Change-Id: I313cfef202b1e06c583b0b47cd5d0e0888a7dbe7
* bootstat: fix test regression (exec_background)Mark Salyzyn2017-10-251-0/+2
| | | | | | | | | | | Deal with regression from 557a9d4054f6da38bc000a5842582d2afbc23294 where bootstat was moved to exec_background and actions delayed to improve boot time. Add a 1 second sleep rather than trying to inspect the dmesg (debug only) for clues to the end of bootstat. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I87dfb6a07130112bf51c367632967efa53ea2534
* bootstat: fix test regression (extra logging)Mark Salyzyn2017-10-251-0/+1
| | | | | | | | | Deal with regression from 9a3870490a005ac73dc1e2be202e0824cc239e43 where additional content is logged and should be ignored. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I70709ba5b00ea18a653ff8d1658556b7d4c48775
* Merge "bootstat: Add more boot reasons found by logging in the wild."Treehugger Robot2017-10-191-0/+11
|\
| * bootstat: Add more boot reasons found by logging in the wild.James Hawkins2017-10-191-0/+11
| | | | | | | | | | | | Bug: none Test: none Change-Id: I7e388326be44aeb3e6fdb79d2e173dc17eb8bc1f
* | bootstat: remove extraneous android_logcat_destroy.Josh Gao2017-10-181-1/+0
|/ | | | | | | | android_logcat_pclose already does that. Bug: http://b/67960705 Test: mma Change-Id: I03d06b10807e8a313c9654c2e1db36bfb59e3f99
* bootstat: test: duration fixesMark Salyzyn2017-10-131-1/+5
| | | | | | | | misspelled duration_test in test_thermal_shutdown Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I5981fa899db84199aefb46c8741511e6889bc79c
* bootstat: test: inject ro.boot.bootreason valuesMark Salyzyn2017-10-113-28/+172
| | | | | | | | | | | | | | | | | | | | | Adding a set of automated engineering unit tests with a strict list of prerequisites. Not meant for "user" builds. Must have a crafted bootloader that does not set the boot reason. Only works on platforms where the bootloader either by accident or specifically does not set the ro.boot.bootreason via kernel command line configuration androidboot.bootreason=. If the tests do not have the prerequisites, the test will report success, but with protest. These new tests should work on current Hikey and Hikey960 bootloaders but could very well become obsolete if those platform bootloaders start setting the boot reason. We do not want a platform solution as it could allow a third party to override the bootloader boot reason. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I1793184a8484b83e1d9077475bc65af9816dadf7
* Merge "bootstat: test: refine reported test durations"Mark Salyzyn2017-10-111-19/+70
|\
| * bootstat: test: refine reported test durationsMark Salyzyn2017-10-111-19/+70
| | | | | | | | | | | | | | | | | | | | | | Use actual test durations to refine future duration estimates. Better estimates are cosmetic, but lend confidence to the test results. SideEffects: none Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: I49143b78a6dc6fb21838a3d6c70b7eb5a8b4cba5
* | Merge "bootstat: Add some reserved sys.boot.reason values to enumeration"Mark Salyzyn2017-10-111-0/+5
|\|