From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Cc: V Srivatsa <vsrivatsa@in.ibm.com>,
kexec@lists.infradead.org, Dave Anderson <anderson@redhat.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Reinhard <BUENDGEN@de.ibm.com>
Subject: Re: [PATCH v2 7/8] makedumpfile: Add erased information in compressed kdump file
Date: Tue, 16 Aug 2011 15:46:09 +0530 [thread overview]
Message-ID: <4E4A4369.1000008@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110816100035.e27d97c0.oomichi@mxs.nes.nec.co.jp>
Hi Ken'ichi,
On 08/16/2011 06:30 AM, Ken'ichi Ohmichi wrote:
>
> Hi Mahesh,
>
> On Wed, 18 May 2011 01:36:17 +0530
> Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>> @@ -9452,6 +9747,7 @@ reassemble_kdump_pages(void)
>> struct cache_data cd_pd, cd_data;
>> struct timeval tv_start;
>> char *data = NULL;
>> + unsigned long data_buf_size = info->page_size;
>>
>> initialize_2nd_bitmap(&bitmap2);
>>
>> @@ -9465,7 +9761,7 @@ reassemble_kdump_pages(void)
>> free_cache_data(&cd_pd);
>> return FALSE;
>> }
>> - if ((data = malloc(info->page_size)) == NULL) {
>> + if ((data = malloc(data_buf_size)) == NULL) {
>> ERRMSG("Can't allcate memory for page data.\n");
>> free_cache_data(&cd_pd);
>> free_cache_data(&cd_data);
>> @@ -9570,6 +9866,49 @@ reassemble_kdump_pages(void)
>> if (!write_cache_bufsz(&cd_data))
>> goto out;
>>
>> + info->offset_eraseinfo = cd_data.offset;
>> + /* Copy eraseinfo from split dumpfiles to o/p dumpfile */
>> + for (i = 0; i < info->num_dumpfile; i++) {
>> + if (!SPLITTING_SIZE_EI(i))
>> + continue;
>> +
>> + if (SPLITTING_SIZE_EI(i) > data_buf_size) {
>> + data_buf_size = SPLITTING_SIZE_EI(i);
>> + if ((data = realloc(data, data_buf_size)) == NULL) {
>> + ERRMSG("Can't allcate memory for eraseinfo"
>> + " data.\n");
>> + goto out;
>> + }
>> + }
>> + if ((fd = open(SPLITTING_DUMPFILE(i), O_RDONLY)) < 0) {
>> + ERRMSG("Can't open a file(%s). %s\n",
>> + SPLITTING_DUMPFILE(i), strerror(errno));
>> + goto out;
>> + }
>> + if (lseek(fd, SPLITTING_OFFSET_EI(i), SEEK_SET) < 0) {
>> + ERRMSG("Can't seek a file(%s). %s\n",
>> + SPLITTING_DUMPFILE(i), strerror(errno));
>> + goto out;
>> + }
>> + if (read(fd, data, SPLITTING_SIZE_EI(i)) !=
>> + SPLITTING_SIZE_EI(i)) {
>> + ERRMSG("Can't read a file(%s). %s\n",
>> + SPLITTING_DUMPFILE(i), strerror(errno));
>> + goto out;
>> + }
>> + if (!write_cache(&cd_data, data, SPLITTING_SIZE_EI(i)))
>> + goto out;
>> + info->size_eraseinfo += SPLITTING_SIZE_EI(i);
>> +
>> + close(fd);
>> + fd = 0;
>> + }
>> + if (!write_cache_bufsz(&cd_data))
>> + goto out;
>> +
>> + if (!update_sub_header())
>> + goto out;
>
> The above update_sub_header() breaks "--reassemble" option if a dumpfile
> does not contain eraseinfo data :
My bad. Thanks for catching it.
Thanks,
-Mahesh.
>
> ---
> # makedumpfile --split -d30 vmcore dump.1 dump.2
> Copying data : [100 %]
> Copying data : [100 %]
>
> The dumpfiles are saved to dump.1, and dump.2.
>
> makedumpfile Completed.
> # makedumpfile --reassemble dump.1 dump.2 dump.3
> Copying data : [100 %]
> The dumpfile is saved to dump.3.
>
> makedumpfile Completed.
> # crash vmlinux dump.3
> [..]
>
> crash: page excluded: kernel virtual address: ffffffff8040b220 type: "cpu_possible_mask"
> #
> ---
>
> The cause is that info->sub_header, which is written in update_sub_header(),
> is filled with 0x0.
> The following change fixes this problem:
>
> ---
> @@ -9378,6 +9680,7 @@ reassemble_kdump_header(void)
> info->name_dumpfile, strerror(errno));
> return FALSE;
> }
> + memcpy(&info->sub_header, &kh, sizeof(kh));
>
> /*
> * Write dump bitmap to both a dumpfile and a bitmap file.
> ---
>
> Thanks
> Ken'ichi Ohmichi
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2011-08-16 10:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 20:06 [PATCH v2 7/8] makedumpfile: Add erased information in compressed kdump file Mahesh J Salgaonkar
2011-08-12 8:10 ` Ken'ichi Ohmichi
2011-08-18 8:14 ` Mahesh Jagannath Salgaonkar
2011-08-19 5:39 ` Ken'ichi Ohmichi
2011-08-16 1:00 ` Ken'ichi Ohmichi
2011-08-16 10:16 ` Mahesh Jagannath Salgaonkar [this message]
2011-08-19 6:16 ` Ken'ichi Ohmichi
2011-08-22 11:57 ` Mahesh J Salgaonkar
2011-09-06 15:44 ` Mahesh J Salgaonkar
2011-09-07 6:59 ` Ken'ichi Ohmichi
2011-09-12 18:24 ` makedumpfile: Add erased information in compressed kdump file and ELF formatted dumpfile Dave Anderson
2011-09-13 11:16 ` Mahesh Jagannath Salgaonkar
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=4E4A4369.1000008@linux.vnet.ibm.com \
--to=mahesh@linux.vnet.ibm.com \
--cc=BUENDGEN@de.ibm.com \
--cc=ananth@in.ibm.com \
--cc=anderson@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=oomichi@mxs.nes.nec.co.jp \
--cc=vsrivatsa@in.ibm.com \
/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