dumpstate: Also pick up /sys/fs/pstore/console-ramoops-0 for LAST KMSG (cherry pick from commit 7d0a762ecaf9f4d005f0f6db913034c2e084d362) Bug: 29639467 Change-Id: Iba0b1754eaebfb2b0624dcbef522b7d8456eeb50
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 5fe1f90..5c31d6b 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp
@@ -67,6 +67,7 @@ static std::string suffix; #define PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops" +#define ALT_PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops-0" #define RAFT_DIR "/data/misc/raft/" #define RECOVERY_DIR "/cache/recovery" @@ -779,6 +780,8 @@ if (!stat(PSTORE_LAST_KMSG, &st)) { /* Also TODO: Make console-ramoops CAP_SYSLOG protected. */ dump_file("LAST KMSG", PSTORE_LAST_KMSG); + } else if (!stat(ALT_PSTORE_LAST_KMSG, &st)) { + dump_file("LAST KMSG", ALT_PSTORE_LAST_KMSG); } else { /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */ dump_file("LAST KMSG", "/proc/last_kmsg");