healthd: charger mode dump previous console from pstore

Change-Id: Id65ffe4f80aa870a1d1f3f3d67c3bb687490c27f
This commit is contained in:
Todd Poynor 2013-11-22 17:52:59 -08:00
parent 4b2a57697d
commit cd7c10438a
1 changed files with 8 additions and 3 deletions

View File

@ -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);