From ec7bafee9425e9ad131454043de7af58f397f8f9 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 26 Sep 2018 08:01:04 -0700 Subject: [PATCH 1/2] bootstat: uvlo -> reboot,undervoltage uvlo anywhere in boot loader reason string will match and convert to reboot,undervoltage when propagated to system boot reason. Test: compile Bug: 63736262 Change-Id: I14b0b7e8185aa4fb519efdb6cb1306718e9de69c --- bootstat/bootstat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index c17e00ffe..f25c5d17e 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -236,7 +236,7 @@ const std::map kBootReasonMap = { {"reboot,rescueparty", 90}, {"charge", 91}, {"oem_tz_crash", 92}, - {"uvlo", 93}, + {"uvlo", 93}, // aliasReasons converts to reboot,undervoltage {"oem_ps_hold", 94}, {"abnormal_reset", 95}, {"oemerr_unknown", 96}, @@ -263,7 +263,7 @@ const std::map kBootReasonMap = { {"oem_crash_on_the_lk", 117}, {"oem_rpm_reset", 118}, {"REUSE1", 119}, // Former dupe, can be re-used - {"REUSE2", 120}, // Former dupe, can be re-used + {"reboot,undervoltage", 120}, {"factory_cable", 121}, {"oem_ar6320_failed_to_powerup", 122}, {"watchdog_rpm_bite", 123}, @@ -840,6 +840,7 @@ std::string BootReasonStrToReason(const std::string& boot_reason) { {"reboot,tool", "tool_by_pass_pwk"}, {"!reboot,longkey", "reboot_longkey"}, {"!reboot,longkey", "kpdpwr"}, + {"!reboot,undervoltage", "uvlo"}, {"bootloader", ""}, }; From f62983a6467b8d1ca0b562d5432f75f6079105fe Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 26 Sep 2018 09:55:25 -0700 Subject: [PATCH 2/2] bootstat: smpl -> reboot,powerloss smpl anywhere in boot loader reason string will match and convert to reboot,powerloss when propagated to system boot reason. Test: compile Bug: 63736262 Change-Id: I156bfefd05d2bab480408cf6bb1dc4c61c8983f9 --- bootstat/bootstat.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index f25c5d17e..6700b6cae 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -248,9 +248,9 @@ const std::map kBootReasonMap = { {"watchdog_nonsec", 102}, {"watchdog_apps_bark", 103}, {"reboot_dmverity_corrupted", 104}, - {"reboot_smpl", 105}, + {"reboot_smpl", 105}, // aliasReasons converts to reboot,powerloss {"watchdog_sdi_apps_reset", 106}, - {"smpl", 107}, + {"smpl", 107}, // aliasReasons converts to reboot,powerloss {"oem_modem_failed_to_powerup", 108}, {"reboot_normal", 109}, {"oem_lpass_cfg", 110}, @@ -262,7 +262,7 @@ const std::map kBootReasonMap = { {"oem_rpm_undef_error", 116}, {"oem_crash_on_the_lk", 117}, {"oem_rpm_reset", 118}, - {"REUSE1", 119}, // Former dupe, can be re-used + {"reboot,powerloss", 119}, {"reboot,undervoltage", 120}, {"factory_cable", 121}, {"oem_ar6320_failed_to_powerup", 122}, @@ -841,6 +841,7 @@ std::string BootReasonStrToReason(const std::string& boot_reason) { {"!reboot,longkey", "reboot_longkey"}, {"!reboot,longkey", "kpdpwr"}, {"!reboot,undervoltage", "uvlo"}, + {"!reboot,powerloss", "smpl"}, {"bootloader", ""}, };