summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-11-22 17:52:59 -0800
committerTodd Poynor <toddpoynor@google.com>2013-12-10 22:22:43 +0000
commitcd7c10438a3ea744a937a2100440e20a3960d745 (patch)
treee9e6468eb82fa5b3c6938cd80a9959f3aa6eb6ba
parent4b2a57697df5f4e3f4075edc9ad736f79edf9a40 (diff)
downloadsystem_core-cd7c10438a3ea744a937a2100440e20a3960d745.zip
system_core-cd7c10438a3ea744a937a2100440e20a3960d745.tar.gz
system_core-cd7c10438a3ea744a937a2100440e20a3960d745.tar.bz2
healthd: charger mode dump previous console from pstore
Change-Id: Id65ffe4f80aa870a1d1f3f3d67c3bb687490c27f
-rw-r--r--healthd/healthd_mode_charger.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index fe96c86..025d530 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -65,6 +65,7 @@
#define BATTERY_FULL_THRESH 95
#define LAST_KMSG_PATH "/proc/last_kmsg"
+#define LAST_KMSG_PSTORE_PATH "/sys/fs/pstore/console-ramoops"
#define LAST_KMSG_MAX_SZ (32 * 1024)
#define LOGE(x...) do { KLOG_ERROR("charger", x); } while (0)
@@ -200,10 +201,14 @@ static void dump_last_kmsg(void)
LOGI("\n");
LOGI("*************** LAST KMSG ***************\n");
LOGI("\n");
- buf = (char *)load_file(LAST_KMSG_PATH, &sz);
+ buf = (char *)load_file(LAST_KMSG_PSTORE_PATH, &sz);
+
if (!buf || !sz) {
- LOGI("last_kmsg not found. Cold reset?\n");
- goto out;
+ buf = (char *)load_file(LAST_KMSG_PATH, &sz);
+ if (!buf || !sz) {
+ LOGI("last_kmsg not found. Cold reset?\n");
+ goto out;
+ }
}
len = min(sz, LAST_KMSG_MAX_SZ);