Merge tag 'pstore-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Pull one pstore patch from Tony Luck * tag 'pstore-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: pstore: Introduce get_reason_str() to pstore
This commit is contained in:
@@ -68,9 +68,25 @@ void pstore_set_kmsg_bytes(int bytes)
|
|||||||
/* Tag each group of saved records with a sequence number */
|
/* Tag each group of saved records with a sequence number */
|
||||||
static int oopscount;
|
static int oopscount;
|
||||||
|
|
||||||
static char *reason_str[] = {
|
static const char *get_reason_str(enum kmsg_dump_reason reason)
|
||||||
"Oops", "Panic", "Kexec", "Restart", "Halt", "Poweroff", "Emergency"
|
{
|
||||||
};
|
switch (reason) {
|
||||||
|
case KMSG_DUMP_PANIC:
|
||||||
|
return "Panic";
|
||||||
|
case KMSG_DUMP_OOPS:
|
||||||
|
return "Oops";
|
||||||
|
case KMSG_DUMP_EMERG:
|
||||||
|
return "Emergency";
|
||||||
|
case KMSG_DUMP_RESTART:
|
||||||
|
return "Restart";
|
||||||
|
case KMSG_DUMP_HALT:
|
||||||
|
return "Halt";
|
||||||
|
case KMSG_DUMP_POWEROFF:
|
||||||
|
return "Poweroff";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* callback from kmsg_dump. (s2,l2) has the most recently
|
* callback from kmsg_dump. (s2,l2) has the most recently
|
||||||
@@ -85,17 +101,15 @@ static void pstore_dump(struct kmsg_dumper *dumper,
|
|||||||
unsigned long s1_start, s2_start;
|
unsigned long s1_start, s2_start;
|
||||||
unsigned long l1_cpy, l2_cpy;
|
unsigned long l1_cpy, l2_cpy;
|
||||||
unsigned long size, total = 0;
|
unsigned long size, total = 0;
|
||||||
char *dst, *why;
|
char *dst;
|
||||||
|
const char *why;
|
||||||
u64 id;
|
u64 id;
|
||||||
int hsize, ret;
|
int hsize, ret;
|
||||||
unsigned int part = 1;
|
unsigned int part = 1;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
int is_locked = 0;
|
int is_locked = 0;
|
||||||
|
|
||||||
if (reason < ARRAY_SIZE(reason_str))
|
why = get_reason_str(reason);
|
||||||
why = reason_str[reason];
|
|
||||||
else
|
|
||||||
why = "Unknown";
|
|
||||||
|
|
||||||
if (in_nmi()) {
|
if (in_nmi()) {
|
||||||
is_locked = spin_trylock(&psinfo->buf_lock);
|
is_locked = spin_trylock(&psinfo->buf_lock);
|
||||||
|
Reference in New Issue
Block a user