Tool for creating full vmcore
Corey Minyard
minyard at acm.org
Wed Feb 12 15:21:23 EST 2014
Hello,
I've written a tool that takes an coredump of physical kernel memory and
converts it to a coredump of virtual kernel memory that can be directly
used by gdb to debug a kernel.
I was trying to use /proc/vmcore, but that did not include any of
vmalloc memory or vmemmap, which made it kind of useless. I thought
about adding all that to the vmcore, but that didn't seem like the
proper way to do things.
The tool is at https://github.com/cminyard/kdump-tool
It can create a physical memory coredump (like the kdump tool) and a
virtual memory coredump (either from a physical memory one, or directly
from /proc/vmcore and /dev/mem).
Two kernel patches are in the "kernel-patches" directory of the tool, on
the master branch:
One adds the valid physical memory ranges to the notes in the core
file. Memory doesn't always start from zero, some systems have more
than one OS running on the same hardware, and memory often has holes
and places that are bad to read from. It seems prudent to pass in these
ranges so the coredump is only the memory required. It also adds the
physical address of the kernel page directory to the notes, so it can
parse the page tables.
The other is MIPS specific. You need a whole bunch of information about
the configuration to parse the MIPS page tables.
One cool thing this should be able to do is create a coredump for
userspace processes. You can look into kernel memory to find the page
table and pass that in to the tool. It should be able to extract the
process' resident memory from a physical coredump. Of course, it will
only dump resident memory, anything on disk will not be there.
Is this interesting to the kdump community? I'd like to include it in
kexec, if possible.
Thanks,
-corey
More information about the kexec
mailing list