mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 08:34:20 +08:00
One pstore patch
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJPa7HFAAoJEKurIx+X31iBtm8P/1wtBftqpdXiNXbuphWMxZAb FmzVSrlCRpbPB4HQjY64bs8BCR3zCeeGPf19Mx3mDrrY8o5ENlWEz/8eZNsXeiyS WMNIPrUevxRfsnPO61TizZ0JvPiCouQarRovYh0FW32PC8/9I2yYIM0Mj+L1P+b9 FZgjk5Jeg+kEoDZZM6HepX500/iZjsPBuyysJ91JPVNzQJNHPJUYvHwPx8xYWVva PwdrugkLPFEJSyyc1CNLt3kg9wtDNtWIKUvrjmRl6aRFeLmJBUVBhkxtZD2rrLIm oOvGY+UdlTCg5vHHAYtc4oAVnZiXUxFaotH0Msa8ots6ORvKAXKBBmXTwS2bce8Q DUtqs/CU6X3LykRDyuCRvjuwuH5e4WUM3SMCSWuxk8ZOCiYWHwqMaaWYIBUDAWIm AXFbP29M95hdWd/jvZUxwJCXRc2Vr/MEXNkQzPWIw8eAewP+2jbqLLICjXqVK0Vp vkHmhVTN07ajbz/dJsJ3K2JObVal+1YEL96DdW+nstdmgNPiDhyLibVS/WH8qOq/ k9s175e3kLOaLU1LCBdKy4TbG3fGg7f1FUVePelbmTSF9gRSz0Mz3jMyrvoFS7jQ //ra4HlrbUHHwwsK8R5axZGa2ejezLIc7/wdgRlEy2ZffqytNMPJ4RwCk0Ft1YJ2 pbD9OUSUqwhRrtbxJWJd =MzvB -----END PGP SIGNATURE----- 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:
commit
6e55f8ed81
@ -68,9 +68,25 @@ void pstore_set_kmsg_bytes(int bytes)
|
||||
/* Tag each group of saved records with a sequence number */
|
||||
static int oopscount;
|
||||
|
||||
static char *reason_str[] = {
|
||||
"Oops", "Panic", "Kexec", "Restart", "Halt", "Poweroff", "Emergency"
|
||||
};
|
||||
static const char *get_reason_str(enum kmsg_dump_reason reason)
|
||||
{
|
||||
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
|
||||
@ -85,17 +101,15 @@ static void pstore_dump(struct kmsg_dumper *dumper,
|
||||
unsigned long s1_start, s2_start;
|
||||
unsigned long l1_cpy, l2_cpy;
|
||||
unsigned long size, total = 0;
|
||||
char *dst, *why;
|
||||
char *dst;
|
||||
const char *why;
|
||||
u64 id;
|
||||
int hsize, ret;
|
||||
unsigned int part = 1;
|
||||
unsigned long flags = 0;
|
||||
int is_locked = 0;
|
||||
|
||||
if (reason < ARRAY_SIZE(reason_str))
|
||||
why = reason_str[reason];
|
||||
else
|
||||
why = "Unknown";
|
||||
why = get_reason_str(reason);
|
||||
|
||||
if (in_nmi()) {
|
||||
is_locked = spin_trylock(&psinfo->buf_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user