am 2a83daa8
: dumpstate: dump console-ramoops instead of last_kmsg if present
* commit '2a83daa8a3e1eab292dc1464bbe78f025f4bc0e9': dumpstate: dump console-ramoops instead of last_kmsg if present
This commit is contained in:
commit
34ced636fb
@ -43,6 +43,8 @@ static const char *dump_traces_path = NULL;
|
|||||||
|
|
||||||
static char screenshot_path[PATH_MAX] = "";
|
static char screenshot_path[PATH_MAX] = "";
|
||||||
|
|
||||||
|
#define PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops"
|
||||||
|
|
||||||
/* dumps the current system state to stdout */
|
/* dumps the current system state to stdout */
|
||||||
static void dumpstate() {
|
static void dumpstate() {
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
@ -161,8 +163,14 @@ static void dumpstate() {
|
|||||||
dump_file("NETWORK ROUTES", "/proc/net/route");
|
dump_file("NETWORK ROUTES", "/proc/net/route");
|
||||||
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
|
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
|
||||||
|
|
||||||
|
if (!stat(PSTORE_LAST_KMSG, &st)) {
|
||||||
|
/* Also TODO: Make console-ramoops CAP_SYSLOG protected. */
|
||||||
|
dump_file("LAST KMSG", PSTORE_LAST_KMSG);
|
||||||
|
} else {
|
||||||
/* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
|
/* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
|
||||||
dump_file("LAST KMSG", "/proc/last_kmsg");
|
dump_file("LAST KMSG", "/proc/last_kmsg");
|
||||||
|
}
|
||||||
|
|
||||||
dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
|
dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
|
||||||
dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
|
dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user