public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: Cliff Wickman <cpw@sgi.com>
Cc: kexec@lists.infradead.org, kumagai-atsushi@mxc.nes.nec.co.jp
Subject: Re: [PATCH] makedumpfile: search for a debug vmlinux
Date: Fri, 30 Aug 2013 10:11:09 +0900	[thread overview]
Message-ID: <521FF12D.3050505@jp.fujitsu.com> (raw)
In-Reply-To: <E1VEnuJ-0000KR-TT@eag09.americas.sgi.com>

(2013/08/29 7:08), Cliff Wickman wrote:
> From: Cliff Wickman <cpw@sgi.com>
> 
> 
> makedumpfile needs the debug info from either /proc/vmcore or in vmlinux
> to know how to find free pages using the buddy method.
> 
> The distro procedures do not pass the vmlinux (with the -x option), so
> add a search for a debug vmlinux in the usual locations.
> It's not needed if the page info is in vmcore.  But warn if it is found
> in neither place.
> 

makedumpfile is designed to get necessary debug information from VMCOREINFO note
available from /proc/vmcore. Why do you need vmlinux?

<cut>

> @@ -8740,6 +8747,91 @@ static struct option longopts[] = {
>   	{0, 0, 0, 0}
>   };
>   
> +/*
> + * Look for a debug vmlinux in the usual places.
> + */
> +void
> +find_vmlinux()
> +{
> +	int ret;
> +	char pathname[200];
> +	struct stat stat_buf;
> +
> +	ret = uname(&utsname);
> +	if (ret < 0) {
> +		fprintf(stderr, "uname failed; errno %d", errno);
> +	}
> +
> +	/* these may work if the crash kernel is in multi-user mode */
> +	sprintf(pathname, "/usr/lib/debug/lib/modules/%s/vmlinux",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/usr/lib/debug/boot/vmlinux-%s.debug",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/boot/vmlinux-%s", utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +
> +	/*
> +	 * the crash kernel normally runs with the root device mounted
> +	 * as /root or /mnt
> +	 */

This depends on distributions and their own kdump/kexec userland configuration
tools. I don't think it a good idea. It is the distribution tools that know
where debuginfo files are located and so they should search for debuginfo files
and they should specify them with -x option.

Basically, makedumpfile should not assume root device in the 2nd kernel since
it could be corrupted due to the same crash causing kdump to be triggered.
Also, debug informaiton is very large file over 100MiB and so should not be
included in kdump initramfs. VMCOREINFO was invented so to suppress amount
of debug informaiton as much as possible.

> +	sprintf(pathname, "/root/usr/lib/debug/lib/modules/%s/vmlinux",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/root/usr/lib/debug/boot/vmlinux-%s.debug",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/root/boot/vmlinux-%s", utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/mnt/usr/lib/debug/lib/modules/%s/vmlinux",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/mnt/usr/lib/debug/boot/vmlinux-%s.debug",
> +		utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +	sprintf(pathname, "/mnt/boot/vmlinux-%s", utsname.release);
> +	if (stat(pathname, &stat_buf) == 0) {
> +		info->name_vmlinux = pathname;
> +		PROGRESS_MSG("Using %s.\n", pathname);
> +		return;
> +	}
> +
> +	no_vmlinux = 1;
> +}
> +


-- 
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-08-30  1:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 22:08 [PATCH] makedumpfile: search for a debug vmlinux Cliff Wickman
2013-08-30  1:11 ` HATAYAMA Daisuke [this message]
2013-09-03 18:48   ` Cliff Wickman
2013-09-09  6:55     ` HATAYAMA Daisuke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521FF12D.3050505@jp.fujitsu.com \
    --to=d.hatayama@jp.fujitsu.com \
    --cc=cpw@sgi.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox