* [PATCH 1/5] Cleanup: Set a meaning value for KDUMP_SUB_HEADER_BLOCKS.
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
@ 2009-10-13 5:19 ` Ken'ichi Ohmichi
2009-10-13 5:19 ` [PATCH 2/5] Cleanup: Fix some indents in write_kdump_header() Ken'ichi Ohmichi
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-13 5:19 UTC (permalink / raw)
To: Ken'ichi Ohmichi; +Cc: kexec, tindoh, usui, CAI Qian, anderson
[PATCH 1/5] Cleanup: Set a meaning value for KDUMP_SUB_HEADER_BLOCKS.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/diskdump_mod.h b/diskdump_mod.h
--- a/diskdump_mod.h 2009-10-09 10:51:18.000000000 +0900
+++ b/diskdump_mod.h 2009-10-13 11:02:05.000000000 +0900
@@ -25,7 +25,6 @@
#define KDUMP_SIGNATURE "KDUMP "
#define SIG_LEN (sizeof(DUMP_PARTITION_SIGNATURE) - 1)
#define DISKDUMP_HDADER_BLOCKS (1)
-#define KDUMP_SUB_HEADER_BLOCKS (1)
#define DUMP_HEADER_COMPLETED 0
#define DUMP_HEADER_INCOMPLETED 1
diff -rpuN a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2009-10-09 10:51:18.000000000 +0900
+++ b/makedumpfile.c 2009-10-13 11:06:25.000000000 +0900
@@ -5450,7 +5450,7 @@ write_kdump_header(void)
strcpy(dh->signature, KDUMP_SIGNATURE);
dh->header_version = 2;
dh->block_size = info->page_size;
- dh->sub_hdr_size = KDUMP_SUB_HEADER_BLOCKS;
+ dh->sub_hdr_size = divideup(sizeof(sub_dump_header), dh->block_size);
dh->max_mapnr = info->max_mapnr;
dh->nr_cpus = 1;
dh->bitmap_blocks
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 2/5] Cleanup: Fix some indents in write_kdump_header().
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
2009-10-13 5:19 ` [PATCH 1/5] Cleanup: Set a meaning value for KDUMP_SUB_HEADER_BLOCKS Ken'ichi Ohmichi
@ 2009-10-13 5:19 ` Ken'ichi Ohmichi
2009-10-13 5:20 ` {PATCH 3/5] Cleanup: Shorten the declaration name of kdump_sub_header Ken'ichi Ohmichi
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-13 5:19 UTC (permalink / raw)
To: Ken'ichi Ohmichi; +Cc: kexec, tindoh, usui, CAI Qian, anderson
[PATCH 2/5] Cleanup: Fix some indents in write_kdump_header().
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2009-10-13 11:07:33.000000000 +0900
+++ b/makedumpfile.c 2009-10-13 11:08:56.000000000 +0900
@@ -5449,12 +5449,11 @@ write_kdump_header(void)
*/
strcpy(dh->signature, KDUMP_SIGNATURE);
dh->header_version = 2;
- dh->block_size = info->page_size;
- dh->sub_hdr_size = divideup(sizeof(sub_dump_header), dh->block_size);
- dh->max_mapnr = info->max_mapnr;
- dh->nr_cpus = 1;
- dh->bitmap_blocks
- = divideup(info->len_bitmap, dh->block_size);
+ dh->block_size = info->page_size;
+ dh->sub_hdr_size = divideup(sizeof(sub_dump_header), dh->block_size);
+ dh->max_mapnr = info->max_mapnr;
+ dh->nr_cpus = 1;
+ dh->bitmap_blocks = divideup(info->len_bitmap, dh->block_size);
memcpy(&dh->timestamp, &info->timestamp, sizeof(dh->timestamp));
memcpy(&dh->utsname, &info->system_utsname, sizeof(dh->utsname));
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 12+ messages in thread* {PATCH 3/5] Cleanup: Shorten the declaration name of kdump_sub_header.
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
2009-10-13 5:19 ` [PATCH 1/5] Cleanup: Set a meaning value for KDUMP_SUB_HEADER_BLOCKS Ken'ichi Ohmichi
2009-10-13 5:19 ` [PATCH 2/5] Cleanup: Fix some indents in write_kdump_header() Ken'ichi Ohmichi
@ 2009-10-13 5:20 ` Ken'ichi Ohmichi
2009-10-13 5:20 ` [PATCH 4/5] Store vmcoreinfo data into a kdump-compressed dumpfile Ken'ichi Ohmichi
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-13 5:20 UTC (permalink / raw)
To: Ken'ichi Ohmichi; +Cc: kexec, tindoh, usui, CAI Qian, anderson
{PATCH 3/5] Cleanup: Shorten the declaration name of kdump_sub_header.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2009-10-13 12:18:10.000000000 +0900
+++ b/makedumpfile.c 2009-10-13 12:19:21.000000000 +0900
@@ -5439,7 +5439,7 @@ write_kdump_header(void)
{
size_t size;
struct disk_dump_header *dh = info->dump_header;
- struct kdump_sub_header sub_dump_header;
+ struct kdump_sub_header kh;
if (info->flag_elf_dumpfile)
return FALSE;
@@ -5450,7 +5450,7 @@ write_kdump_header(void)
strcpy(dh->signature, KDUMP_SIGNATURE);
dh->header_version = 2;
dh->block_size = info->page_size;
- dh->sub_hdr_size = divideup(sizeof(sub_dump_header), dh->block_size);
+ dh->sub_hdr_size = divideup(sizeof(kh), dh->block_size);
dh->max_mapnr = info->max_mapnr;
dh->nr_cpus = 1;
dh->bitmap_blocks = divideup(info->len_bitmap, dh->block_size);
@@ -5465,15 +5465,15 @@ write_kdump_header(void)
* Write sub header
*/
size = sizeof(struct kdump_sub_header);
- memset(&sub_dump_header, 0, size);
- sub_dump_header.phys_base = info->phys_base;
- sub_dump_header.dump_level = info->dump_level;
+ memset(&kh, 0, size);
+ kh.phys_base = info->phys_base;
+ kh.dump_level = info->dump_level;
if (info->flag_split) {
- sub_dump_header.split = 1;
- sub_dump_header.start_pfn = info->split_start_pfn;
- sub_dump_header.end_pfn = info->split_end_pfn;
+ kh.split = 1;
+ kh.start_pfn = info->split_start_pfn;
+ kh.end_pfn = info->split_end_pfn;
}
- if (!write_buffer(info->fd_dumpfile, dh->block_size, &sub_dump_header,
+ if (!write_buffer(info->fd_dumpfile, dh->block_size, &kh,
size, info->name_dumpfile))
return FALSE;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 4/5] Store vmcoreinfo data into a kdump-compressed dumpfile.
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
` (2 preceding siblings ...)
2009-10-13 5:20 ` {PATCH 3/5] Cleanup: Shorten the declaration name of kdump_sub_header Ken'ichi Ohmichi
@ 2009-10-13 5:20 ` Ken'ichi Ohmichi
2009-10-13 5:20 ` [PATCH 5/5] Read vmcoreinfo data from " Ken'ichi Ohmichi
2009-10-16 15:59 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering CAI Qian
5 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-13 5:20 UTC (permalink / raw)
To: Ken'ichi Ohmichi; +Cc: kexec, tindoh, usui, CAI Qian, anderson
[PATCH 4/5] Store vmcoreinfo data into a kdump-compressed dumpfile.
By applying this patch, makedumpfile takes vmcoreinfo data from
/proc/vmcore and stores the data into a dumpfile in the kdump-
compressed fomat. By the next patch, makedumpfile takes the data
from a dumpfile in the kdump-compressed format and uses the data
for re-filtering.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/diskdump_mod.h b/diskdump_mod.h
--- a/diskdump_mod.h 2009-10-13 12:19:53.000000000 +0900
+++ b/diskdump_mod.h 2009-10-13 12:20:03.000000000 +0900
@@ -71,6 +71,8 @@ struct kdump_sub_header {
int split; /* header_version 2 and later */
unsigned long start_pfn; /* header_version 2 and later */
unsigned long end_pfn; /* header_version 2 and later */
+ off_t offset_vmcoreinfo;/* header_version 3 and later */
+ unsigned long size_vmcoreinfo; /* header_version 3 and later */
};
/* page flags */
diff -rpuN a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2009-10-13 12:19:53.000000000 +0900
+++ b/makedumpfile.c 2009-10-13 12:23:49.000000000 +0900
@@ -5437,9 +5437,11 @@ out:
int
write_kdump_header(void)
{
+ int ret = FALSE;
size_t size;
struct disk_dump_header *dh = info->dump_header;
struct kdump_sub_header kh;
+ char *buf = NULL;
if (info->flag_elf_dumpfile)
return FALSE;
@@ -5448,9 +5450,10 @@ write_kdump_header(void)
* Write common header
*/
strcpy(dh->signature, KDUMP_SIGNATURE);
- dh->header_version = 2;
- dh->block_size = info->page_size;
- dh->sub_hdr_size = divideup(sizeof(kh), dh->block_size);
+ dh->header_version = 3;
+ dh->block_size = info->page_size;
+ dh->sub_hdr_size = sizeof(kh) + info->size_vmcoreinfo;
+ dh->sub_hdr_size = divideup(dh->sub_hdr_size, dh->block_size);
dh->max_mapnr = info->max_mapnr;
dh->nr_cpus = 1;
dh->bitmap_blocks = divideup(info->len_bitmap, dh->block_size);
@@ -5473,14 +5476,47 @@ write_kdump_header(void)
kh.start_pfn = info->split_start_pfn;
kh.end_pfn = info->split_end_pfn;
}
+ if (info->offset_vmcoreinfo && info->size_vmcoreinfo) {
+ kh.offset_vmcoreinfo = DISKDUMP_HDADER_BLOCKS * dh->block_size;
+ kh.offset_vmcoreinfo += sizeof(kh);
+ kh.size_vmcoreinfo = info->size_vmcoreinfo;
+
+ buf = malloc(info->size_vmcoreinfo);
+ if (buf == NULL) {
+ ERRMSG("Can't allocate memory for vmcoreinfo. %s\n",
+ strerror(errno));
+ return FALSE;
+ }
+ if (lseek(info->fd_memory, info->offset_vmcoreinfo, SEEK_SET)
+ < 0) {
+ ERRMSG("Can't seek the dump memory(%s). %s\n",
+ info->name_memory, strerror(errno));
+ goto out;
+ }
+ if (read(info->fd_memory, buf, info->size_vmcoreinfo)
+ != info->size_vmcoreinfo) {
+ ERRMSG("Can't read the dump memory(%s). %s\n",
+ info->name_memory, strerror(errno));
+ goto out;
+ }
+ }
if (!write_buffer(info->fd_dumpfile, dh->block_size, &kh,
size, info->name_dumpfile))
- return FALSE;
+ goto out;
+
+ if (!write_buffer(info->fd_dumpfile, kh.offset_vmcoreinfo, buf,
+ kh.size_vmcoreinfo, info->name_dumpfile))
+ goto out;
info->offset_bitmap1
= (DISKDUMP_HDADER_BLOCKS + dh->sub_hdr_size) * dh->block_size;
- return TRUE;
+ ret = TRUE;
+out:
+ if (buf)
+ free(buf);
+
+ return ret;
}
void
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 5/5] Read vmcoreinfo data from a kdump-compressed dumpfile.
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
` (3 preceding siblings ...)
2009-10-13 5:20 ` [PATCH 4/5] Store vmcoreinfo data into a kdump-compressed dumpfile Ken'ichi Ohmichi
@ 2009-10-13 5:20 ` Ken'ichi Ohmichi
2009-10-16 15:59 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering CAI Qian
5 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-13 5:20 UTC (permalink / raw)
To: Ken'ichi Ohmichi; +Cc: kexec, tindoh, usui, CAI Qian, anderson
[PATCH 5/5] Read vmcoreinfo data from a kdump-compressed dumpfile.
makedumpfile takes the data from a dumpfile in the kdump-compressed
format and uses the data for re-filtering.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/makedumpfile.c b/makedumpfile.c
--- a/makedumpfile.c 2009-10-13 12:35:06.000000000 +0900
+++ b/makedumpfile.c 2009-10-13 12:34:44.000000000 +0900
@@ -871,6 +871,11 @@ get_kdump_compressed_header_info(char *f
}
memcpy(info->kh_memory, &kh, sizeof(kh));
+ if (dh.header_version >= 3) {
+ /* A dumpfile contains vmcoreinfo data. */
+ info->offset_vmcoreinfo = kh.offset_vmcoreinfo;
+ info->size_vmcoreinfo = kh.size_vmcoreinfo;
+ }
return TRUE;
error:
free(info->dh_memory);
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
2009-10-13 5:18 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering Ken'ichi Ohmichi
` (4 preceding siblings ...)
2009-10-13 5:20 ` [PATCH 5/5] Read vmcoreinfo data from " Ken'ichi Ohmichi
@ 2009-10-16 15:59 ` CAI Qian
2009-10-19 5:21 ` Ken'ichi Ohmichi
5 siblings, 1 reply; 12+ messages in thread
From: CAI Qian @ 2009-10-16 15:59 UTC (permalink / raw)
To: oomichi; +Cc: usui, tindoh, kexec, caiqian, anderson
Hello Ken'ichi!
This series of patches is working great here.
Thanks!
CAI Qian
From: "Ken'ichi Ohmichi" <oomichi@mxs.nes.nec.co.jp>
Subject: [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
Date: Tue, 13 Oct 2009 14:18:44 +0900
>
> Hi,
>
> Ken'ichi Ohmichi wrote:
>> Hi CAI,
>>
>> Thank you for testing and a good point.
>>
>> CAI Qian wrote:
>>>> makedumpfile version 1.3.4 is released.
>>>> Your comments/patches are welcome.
>>>>
>>>> Changelog:
>>>> o New feature
>>>> - Support kdump-compressed format for input file. (by Takao Indoh)
>>>> A new makedumpfile can read dumpfile which is kdump-compressed format
>>>> instead of /proc/vmcore and re-filter it.
>>> Does it need to specify either a vmlinux or vmcoreinfo file?
>>
>> Yes, we need to do it for re-filtering now.
>> But it is not difficult to implement a feature that it is not
>> necessary to specify either a vmlinux or vmcoreinfo file for
>> re-filtering. I will try to implement the feature.
>
> I created the patchset for implementing the above feature.
> Any comments/patches are welcome.
>
> ---
> [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
>
> makedumpfile v1.3.4 can read a dumpfile which is kdump-compressed
> format instead of /proc/vmcore and re-filter it.
>
> When re-filtering, it is necessary to specify '-x'/'-i' option.
> If not specifying, makedumpfile fails like the following:
>
> # ./makedumpfile -c -d 3 vmcore vmcore.1
> ...
> The dumpfile is saved to vmcore.1
> ...
> #
> # /makedumpfile -c -d 31 vmcore.1 vmcore.2
> vmcore.1 doesn't contain vmcoreinfo.
> Specify '-x' option or '-i' option.
> Commandline parameter is invalid.
> Try `makedumpfile --help' for more information.
> #
>
> For usability, this patchset makes '-x'/'-i' option unnecessary
> for re-filtering.
>
>
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
2009-10-16 15:59 ` [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering CAI Qian
@ 2009-10-19 5:21 ` Ken'ichi Ohmichi
0 siblings, 0 replies; 12+ messages in thread
From: Ken'ichi Ohmichi @ 2009-10-19 5:21 UTC (permalink / raw)
To: CAI Qian; +Cc: usui, tindoh, kexec, anderson
Hi CAI,
CAI Qian wrote:
> Hello Ken'ichi!
>
> This series of patches is working great here.
I'm glad to hear that.
I will merge this patchset into the next release.
Thanks
Ken'ichi Ohmichi
> Thanks!
> CAI Qian
>
> From: "Ken'ichi Ohmichi" <oomichi@mxs.nes.nec.co.jp>
> Subject: [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
> Date: Tue, 13 Oct 2009 14:18:44 +0900
>
>> Hi,
>>
>> Ken'ichi Ohmichi wrote:
>>> Hi CAI,
>>>
>>> Thank you for testing and a good point.
>>>
>>> CAI Qian wrote:
>>>>> makedumpfile version 1.3.4 is released.
>>>>> Your comments/patches are welcome.
>>>>>
>>>>> Changelog:
>>>>> o New feature
>>>>> - Support kdump-compressed format for input file. (by Takao Indoh)
>>>>> A new makedumpfile can read dumpfile which is kdump-compressed format
>>>>> instead of /proc/vmcore and re-filter it.
>>>> Does it need to specify either a vmlinux or vmcoreinfo file?
>>> Yes, we need to do it for re-filtering now.
>>> But it is not difficult to implement a feature that it is not
>>> necessary to specify either a vmlinux or vmcoreinfo file for
>>> re-filtering. I will try to implement the feature.
>> I created the patchset for implementing the above feature.
>> Any comments/patches are welcome.
>>
>> ---
>> [PATCH 0/5] make '-x'/'-i' option unnecessary for re-filtering.
>>
>> makedumpfile v1.3.4 can read a dumpfile which is kdump-compressed
>> format instead of /proc/vmcore and re-filter it.
>>
>> When re-filtering, it is necessary to specify '-x'/'-i' option.
>> If not specifying, makedumpfile fails like the following:
>>
>> # ./makedumpfile -c -d 3 vmcore vmcore.1
>> ...
>> The dumpfile is saved to vmcore.1
>> ...
>> #
>> # /makedumpfile -c -d 31 vmcore.1 vmcore.2
>> vmcore.1 doesn't contain vmcoreinfo.
>> Specify '-x' option or '-i' option.
>> Commandline parameter is invalid.
>> Try `makedumpfile --help' for more information.
>> #
>>
>> For usability, this patchset makes '-x'/'-i' option unnecessary
>> for re-filtering.
>>
>>
>> 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
^ permalink raw reply [flat|nested] 12+ messages in thread