From 0af90f6f750300e54409c251682e86d90401d0ab Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Fri, 22 Nov 2013 16:35:32 -0800 Subject: [PATCH] charger: dump pstore ram console DO NOT MERGE Change-Id: I7f612d49418272e2ac867f64c10149ad616391cd --- charger/charger.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/charger/charger.c b/charger/charger.c index 66ddeaf9c..dda24ae54 100644 --- a/charger/charger.c +++ b/charger/charger.c @@ -67,6 +67,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) @@ -211,10 +212,14 @@ static void dump_last_kmsg(void) LOGI("\n"); LOGI("*************** LAST KMSG ***************\n"); LOGI("\n"); - buf = load_file(LAST_KMSG_PATH, &sz); + buf = load_file(LAST_KMSG_PSTORE_PATH, &sz); + if (!buf || !sz) { - LOGI("last_kmsg not found. Cold reset?\n"); - goto out; + buf = 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);