Re: Determine version of kernel that produced vmcore



On Mon, Jul 09, 2007 at 11:21:54AM +0200, Bernhard Walle wrote:
Hello,

* Dan Aloni <da-x@xxxxxxxxxxxxx> [2007-07-06 16:58]:

Redhat has a makedumpinfo util which they intend to use as slim
kernel-version-independent utility on kdump rootfs in order to
save /proc/vmcore in a compact manner.

I think you mean makedumpfile, don't you?

Yes, a typo, sorry.

A patch that I am working on will make it possible to integrate
the output of 'makedumpinfo -g' into vmlinux as the final build
stage of the kernel. This information will be presented itself
as /proc/kcore.info for the first kernel throughout its entire
execution.

That sounds good. But I doubt that kernel developers like the idea of
needing another utility in the build process ...

I don't think it would add much complexity to build process as it
is now, just like the other tools that transparently do post-linking
modifications. As far as the developer is concerned, there's just
the vmlinux and/or bzImage files that get emitted at the end.

Then inside initramfs of the first kernel, a small
util will modify the vmlinux file of the kdump kernel before it
gets loaded so that another special file appearing as
/proc/vmcore.info under the kdump kernel will present the same
info.

Where do you get the info from? If you're in the kdump initrd,
then the kdump kernel is already loaded. Do you want to attach the
info from the crashed kernel to the initrd of the kdump kernel?

Not exactly. Let me describe the procedure in greater detail.
Basically, it would go like this:

1. <normal bootloader boot>
2. <normal initramfs>
3. embed_configfile /proc/kcore.info /vmlinux-kdump
4. kexec -l vmlinux-kdump <....>
5. <boot continues>
6. <crash>
7. <kdump kernel boot>
8. <kdump initramfs runs>
9. makedumpfile -i /proc/vmcore.info <....>

NOTES:
** in step 3 embed_configfile modifies vmlinux-kdump in place,
copying /proc/kcore.info into the data section of the vmlinux-kdump
at certain symbol (e.g. 'char core_info[0x1000]').
** in step 9 that data section variable (e.g. core_info) which was
originally holds the content of /proc/kcore.info is being presented
as /proc/vmcore.info for the util to use.

To complete the picture, at the final build stage of vmlinux we
would have this:

makedumpfile -g vmlinux.configfile -x vmlinuxx
embed_configfile vmlinux.configfile vmlinux
rm vmlinux.configfile

BTW I think there could be a confusion between makedumpfile's
CONFIGFILE and the .config file, so we should pick a different
name for it...

--
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch] add kdump_after_notifier
    ... I want to use both kdb and kdump, ... The kexec on panic assumption is that the kernel is broken and we better not ... My stance is that _all_ the RAS tools (kdb, kgdb, nlkd, netdump, lkcd, ...
    (Linux-Kernel)
  • Re: oops in :snd_pcm_oss:resample_expand+0x19c/0x1f0
    ... Thanks for trying out kdump. ... For example, the small script you wrote for saving the dump, is already ... "service kdump start" and initrd will be generated and kdump kernel will ... Currently we can use gdb but only for linearly mapped region. ...
    (Linux-Kernel)
  • Re: oops in :snd_pcm_oss:resample_expand+0x19c/0x1f0
    ... A serial console on another PC very much helped in troubleshooting problems (eg. my kdump kernel's initrd was initially too large), but it's not required. ... The distro is the AMD64 Debian etch, with two vanilla 2.6.18 kernels: one "regular" SMP kernel with CONFIG_KEXEC=y, which is what I use, and one UP kernel with CONFIG_PROC_VMCORE=y and a different load address, which is activated on a crash; other than that they are the same. ... This kernel boots on the very same root fs, runs the script below again, this time to save the dump and reboot to the regular kernel. ... _echo "Configuring kdump kernel..." ...
    (Linux-Kernel)
  • Re: [patch] add kdump_after_notifier
    ... I want to use both kdb and kdump, ... The kexec on panic assumption is that the kernel is broken and we better not ... One thing to keep in mind, doing things in second kernel might not be easy ...
    (Linux-Kernel)
  • Re: [Fastboot] [RFC][PATCH] Add missing notifier before crashing
    ... the risk of hanging in between and reducing the reliability of dump operation. ... the kdump kernel and has decided to take a dump in case of a crash event. ... -Doing notification directly in the panic function would only cost a few CPU cycles. ...
    (Linux-Kernel)