···315#define __NR_fanotify_init 1323316#define __NR_fanotify_mark 1324317#define __NR_prlimit64 13250000318319#ifdef __KERNEL__320321322-#define NR_syscalls 302 /* length of syscall table */323324/*325 * The following defines stop scripts/checksyscalls.sh from complaining about
···315#define __NR_fanotify_init 1323316#define __NR_fanotify_mark 1324317#define __NR_prlimit64 1325318+#define __NR_name_to_handle_at 1326319+#define __NR_open_by_handle_at 1327320+#define __NR_clock_adjtime 1328321+#define __NR_syncfs 1329322323#ifdef __KERNEL__324325326+#define NR_syscalls 306 /* length of syscall table */327328/*329 * The following defines stop scripts/checksyscalls.sh from complaining about
···48/* Tag each group of saved records with a sequence number */49static int oopscount;50000051/*52 * callback from kmsg_dump. (s2,l2) has the most recently53 * written bytes, older bytes are in (s1,l1). Save as much···65 unsigned long s1_start, s2_start;66 unsigned long l1_cpy, l2_cpy;67 unsigned long size, total = 0;68- char *dst;69 u64 id;70 int hsize, part = 1;000007172 mutex_lock(&psinfo->buf_mutex);73 oopscount++;74 while (total < kmsg_bytes) {75 dst = psinfo->buf;76- hsize = sprintf(dst, "Oops#%d Part%d\n", oopscount, part++);77 size = psinfo->bufsize - hsize;78 dst += hsize;79···95 memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);9697 id = psinfo->write(PSTORE_TYPE_DMESG, hsize + l1_cpy + l2_cpy);98- if (pstore_is_mounted())99 pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id,100 psinfo->buf, hsize + l1_cpy + l2_cpy,101 CURRENT_TIME, psinfo->erase);
···48/* Tag each group of saved records with a sequence number */49static int oopscount;5051+static char *reason_str[] = {52+ "Oops", "Panic", "Kexec", "Restart", "Halt", "Poweroff", "Emergency"53+};54+55/*56 * callback from kmsg_dump. (s2,l2) has the most recently57 * written bytes, older bytes are in (s1,l1). Save as much···61 unsigned long s1_start, s2_start;62 unsigned long l1_cpy, l2_cpy;63 unsigned long size, total = 0;64+ char *dst, *why;65 u64 id;66 int hsize, part = 1;67+68+ if (reason < ARRAY_SIZE(reason_str))69+ why = reason_str[reason];70+ else71+ why = "Unknown";7273 mutex_lock(&psinfo->buf_mutex);74 oopscount++;75 while (total < kmsg_bytes) {76 dst = psinfo->buf;77+ hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part++);78 size = psinfo->bufsize - hsize;79 dst += hsize;80···86 memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);8788 id = psinfo->write(PSTORE_TYPE_DMESG, hsize + l1_cpy + l2_cpy);89+ if (reason == KMSG_DUMP_OOPS && pstore_is_mounted())90 pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id,91 psinfo->buf, hsize + l1_cpy + l2_cpy,92 CURRENT_TIME, psinfo->erase);