diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2011-10-30 10:16:41 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:42 -0400 |
commit | fa8ff292bb4844cc0b66b7b24d611eb7177f7ded (patch) | |
tree | f6317d981874226ffb64db47fe21d408dc6d1031 /kernel/kexec.c | |
parent | 60a0c68df2632feaa4a986af084650d1165d89c5 (diff) |
[S390] kdump: Initialize vmcoreinfo note at startup
Currently the vmcoreinfo note is only initialized in case of kdump. On s390
it is possible to create kernel dumps with other dump mechanisms than kdump
(e.g. via hypervisor dump or stand-alone dump tools). For those dumps it
would also be desirable to include the vmcoreinfo data. To accomplish this,
with this patch the vmcoreinfo ELF note is always initialized, not only in
case of a (kdump) crash. On s390 we will add an ABI defined pointer at
a well known address to vmcoreinfo so that dump analysis tools are able to
find this information.
In particular on s390 we have a tool named zgetdump. With this tool it is
possible to convert dump formats on the fly using fuse. E.g. you can mount a
s390 stand-alone dump as ELF dump. When this is done, the tool finds the
vmcoreinfo in the stand-alone dump via the well known ABI defined address and
it creates the respective VMCOREINFO ELF note in the output ELF dump. This then
can be used e.g. by makedumpfile for dump filtering. No more need for a
vmlinux file with debug information.
So this will look like the following:
$ zgetdump --mount standalone.dump -f elf /mnt
$ ls /mnt
dump.elf
$ readelf -n /mnt/dump.elf
$ ...
VMCOREINFO 0x00000474 Unknown note type: (0x00000000)
$ makedumpfile -c -d 31 /mnt/dump.elf dump.kdump
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 7204fb982ed5..d3b8a4ceb90b 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -1380,24 +1380,23 @@ int __init parse_crashkernel(char *cmdline, | |||
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | 1382 | ||
1383 | 1383 | static void update_vmcoreinfo_note(void) | |
1384 | void crash_save_vmcoreinfo(void) | ||
1385 | { | 1384 | { |
1386 | u32 *buf; | 1385 | u32 *buf = vmcoreinfo_note; |
1387 | 1386 | ||
1388 | if (!vmcoreinfo_size) | 1387 | if (!vmcoreinfo_size) |
1389 | return; | 1388 | return; |
1390 | |||
1391 | vmcoreinfo_append_str("CRASHTIME=%ld", get_seconds()); | ||
1392 | |||
1393 | buf = (u32 *)vmcoreinfo_note; | ||
1394 | |||
1395 | buf = append_elf_note(buf, VMCOREINFO_NOTE_NAME, 0, vmcoreinfo_data, | 1389 | buf = append_elf_note(buf, VMCOREINFO_NOTE_NAME, 0, vmcoreinfo_data, |
1396 | vmcoreinfo_size); | 1390 | vmcoreinfo_size); |
1397 | |||
1398 | final_note(buf); | 1391 | final_note(buf); |
1399 | } | 1392 | } |
1400 | 1393 | ||
1394 | void crash_save_vmcoreinfo(void) | ||
1395 | { | ||
1396 | vmcoreinfo_append_str("CRASHTIME=%ld", get_seconds()); | ||
1397 | update_vmcoreinfo_note(); | ||
1398 | } | ||
1399 | |||
1401 | void vmcoreinfo_append_str(const char *fmt, ...) | 1400 | void vmcoreinfo_append_str(const char *fmt, ...) |
1402 | { | 1401 | { |
1403 | va_list args; | 1402 | va_list args; |
@@ -1483,6 +1482,7 @@ static int __init crash_save_vmcoreinfo_init(void) | |||
1483 | VMCOREINFO_NUMBER(PG_swapcache); | 1482 | VMCOREINFO_NUMBER(PG_swapcache); |
1484 | 1483 | ||
1485 | arch_crash_save_vmcoreinfo(); | 1484 | arch_crash_save_vmcoreinfo(); |
1485 | update_vmcoreinfo_note(); | ||
1486 | 1486 | ||
1487 | return 0; | 1487 | return 0; |
1488 | } | 1488 | } |