Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: Add description of incomplete dump file
@ 2014-11-12  8:29 Zhou Wenjian
  2014-11-13  9:01 ` Atsushi Kumagai
  0 siblings, 1 reply; 4+ messages in thread
From: Zhou Wenjian @ 2014-11-12  8:29 UTC (permalink / raw)
  To: kexec

Add description of incomplete elf and kdump-compressed dump file
in IMPLEMENTATION.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Signed-off-by: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>
---
 IMPLEMENTATION |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/IMPLEMENTATION b/IMPLEMENTATION
index 2f4cfd6..8f8a945 100644
--- a/IMPLEMENTATION
+++ b/IMPLEMENTATION
@@ -112,3 +112,79 @@
         unsigned long long      page_flags;     /* page flags */
     } page_desc_t;
 
+* The incomplete DUMPFILE
+  When generating DUMPFILE, if ENOSPACE error happens, the DUMPFILE will be
+  incomplete.
+
+  - The incomplete kdump-compressed DUMPFILE
+
+           the complete                  the incomplete
+    +-----------------------+    +-----------------------+
+    |      main header      |    |      main header      |  have incomplete flag
+    |-----------------------+    |-----------------------+
+    |      sub header       |    |      sub header       |
+    |-----------------------+    |-----------------------+
+    |      1st-bitmap       |    |      1st-bitmap       |
+    |-----------------------+    |-----------------------+
+    |      2nd-bitmap       |    |      2nd-bitmap       |
+    |-----------------------+    |-----------------------+
+    | page header for pfn 0 |    | page header for pfn 0 |
+    | page header for pfn 1 |    | page header for pfn 1 |
+    |                  :    |    |                  :    |
+    | page header for pfn N |    | page header for pfn N |  The page headers after
+    |                  :    |    |                       |  N don't exist. The
+    | page header for pfn Z |    |                       |  value of it is zero,
+    |-----------------------|    |-----------------------|  when try to read it.
+    |   page data (pfn 0)   |    |   page data (pfn 0)   |
+    |   page data (pfn 1)   |    |   page data (pfn 1)   |
+    |                  :    |    |                  :    |
+    |   page data (pfn N)   |    |   page data (pfn N)   |
+    |                  :    |    +-----------------------+
+    |   page data (pfn Z)   |
+    +-----------------------+
+
+    The incomplete flag is set into status of disk_dump_header by
+                          status |= DUMP_DH_COMPRESSED_INCOMPLETE
+    DUMP_DH_COMPRESSED_INCOMPLETE : 0x8
+
+    The page header and page data are written in pairs. When writting page data
+    (pfn N+1), if ENOSPACE error happens, the page headers after N won't be
+    written either.
+
+    If there is no page data dumped into the DUMPFILE, the DUMPFILE can't be
+    analysed by crash.
+
+  - The incomplete elf DUMPFILE
+
+      the complete          the incomplete
+    +-------------+         +-------------+
+    |  elf header |         |  elf header |  have incomplete flag
+    |-------------+         |-------------+
+    |  PT_NOTE    |         |  PT_NOTE    |
+    |  PT_LOAD(1) |         |  PT_LOAD(1) |
+    |         :   |         |         :   |
+    |  PT_LOAD(N) |         |  PT_LOAD(N) |  The PT_LOAD after N don't exist.
+    |         :   |         |             |  The value of it is zero, when try
+    |  PT_LOAD(Z) |         |             |  to read it.
+    |-------------+         |-------------+
+    |  sec_hdr    |         |  sec_hdr    |
+    |-------------+         |-------------+
+    |  elf note   |         |  elf note   |
+    |-------------+         |-------------+
+    |  segment(1) |         |  segment(1) |
+    |          :  |         |          :  |
+    |  segment(N) |         |  segment(N) |  The segment(N) is incomplete.
+    |          :  |         +-------------+  The segments after N don't exist.
+    |  segment(Z) |
+    +-------------+
+
+    The incomplete flag is set into e_flags of elf_header by
+                              e_flags |= DUMP_ELF_INCOMPLETE
+    DUMP_ELF_INCOMPLETE : 0x1
+
+    The PT_LOAD and segment are written in pairs. When writting segment(N)
+    , if ENOSPACE error happens, the PT_LOAD after N won't be written
+    either.
+
+    If there is no segment dumped into the DUMPFILE, the DUMPFILE can't be
+    analysed by crash.
-- 
1.7.1


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] makedumpfile: Add description of incomplete dump file
  2014-11-12  8:29 [PATCH] makedumpfile: Add description of incomplete dump file Zhou Wenjian
@ 2014-11-13  9:01 ` Atsushi Kumagai
  2014-11-13  9:29   ` "Zhou, Wenjian/周文剑"
  0 siblings, 1 reply; 4+ messages in thread
From: Atsushi Kumagai @ 2014-11-13  9:01 UTC (permalink / raw)
  To: zhouwj-fnst@cn.fujitsu.com; +Cc: kexec@lists.infradead.org

Hello Zhou,

>Add description of incomplete elf and kdump-compressed dump file
>in IMPLEMENTATION.

That's a good idea, thanks Zhou.
I have some comments.

>Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
>Signed-off-by: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>
>---
> IMPLEMENTATION |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 76 insertions(+), 0 deletions(-)
>
>diff --git a/IMPLEMENTATION b/IMPLEMENTATION
>index 2f4cfd6..8f8a945 100644
>--- a/IMPLEMENTATION
>+++ b/IMPLEMENTATION
>@@ -112,3 +112,79 @@
>         unsigned long long      page_flags;     /* page flags */
>     } page_desc_t;
>
>+* The incomplete DUMPFILE
>+  When generating DUMPFILE, if ENOSPACE error happens, the DUMPFILE will be
>+  incomplete.
>+
>+  - The incomplete kdump-compressed DUMPFILE
>+
>+           the complete                  the incomplete
>+    +-----------------------+    +-----------------------+
>+    |      main header      |    |      main header      |  have incomplete flag
>+    |-----------------------+    |-----------------------+
>+    |      sub header       |    |      sub header       |
>+    |-----------------------+    |-----------------------+
>+    |      1st-bitmap       |    |      1st-bitmap       |
>+    |-----------------------+    |-----------------------+
>+    |      2nd-bitmap       |    |      2nd-bitmap       |
>+    |-----------------------+    |-----------------------+
>+    | page header for pfn 0 |    | page header for pfn 0 |
>+    | page header for pfn 1 |    | page header for pfn 1 |
>+    |                  :    |    |                  :    |
>+    | page header for pfn N |    | page header for pfn N |  The page headers after
>+    |                  :    |    |                       |  N don't exist. The
>+    | page header for pfn Z |    |                       |  value of it is zero,
>+    |-----------------------|    |-----------------------|  when try to read it.
>+    |   page data (pfn 0)   |    |   page data (pfn 0)   |
>+    |   page data (pfn 1)   |    |   page data (pfn 1)   |
>+    |                  :    |    |                  :    |
>+    |   page data (pfn N)   |    |   page data (pfn N)   |
>+    |                  :    |    +-----------------------+
>+    |   page data (pfn Z)   |
>+    +-----------------------+
>+
>+    The incomplete flag is set into status of disk_dump_header by
>+                          status |= DUMP_DH_COMPRESSED_INCOMPLETE
>+    DUMP_DH_COMPRESSED_INCOMPLETE : 0x8
>+
>+    The page header and page data are written in pairs. When writting page data

s/writting/writing/

>+    (pfn N+1), if ENOSPACE error happens, the page headers after N won't be
>+    written either.
>+
>+    If there is no page data dumped into the DUMPFILE, the DUMPFILE can't be
>+    analysed by crash.
>+
>+  - The incomplete elf DUMPFILE

There is no description of the ELF format itself in this documentation
unlike the kdump-compressed format, I would be glad if you could write it.

>+
>+      the complete          the incomplete
>+    +-------------+         +-------------+
>+    |  elf header |         |  elf header |  have incomplete flag
>+    |-------------+         |-------------+
>+    |  PT_NOTE    |         |  PT_NOTE    |
>+    |  PT_LOAD(1) |         |  PT_LOAD(1) |
>+    |         :   |         |         :   |
>+    |  PT_LOAD(N) |         |  PT_LOAD(N) |  The PT_LOAD after N don't exist.
>+    |         :   |         |             |  The value of it is zero, when try
>+    |  PT_LOAD(Z) |         |             |  to read it.
>+    |-------------+         |-------------+

The whole program header must exist since reserve_diskspace()
pre-allocates enough space for it, the description above isn't right.

>+    |  sec_hdr    |         |  sec_hdr    |
>+    |-------------+         |-------------+
>+    |  elf note   |         |  elf note   |
>+    |-------------+         |-------------+
>+    |  segment(1) |         |  segment(1) |
>+    |          :  |         |          :  |
>+    |  segment(N) |         |  segment(N) |  The segment(N) is incomplete.
>+    |          :  |         +-------------+  The segments after N don't exist.
>+    |  segment(Z) |
>+    +-------------+
>+
>+    The incomplete flag is set into e_flags of elf_header by
>+                              e_flags |= DUMP_ELF_INCOMPLETE
>+    DUMP_ELF_INCOMPLETE : 0x1
>+
>+    The PT_LOAD and segment are written in pairs. When writting segment(N)

s/writting/writing/


Thanks,
Atsushi Kumagai

>+    , if ENOSPACE error happens, the PT_LOAD after N won't be written
>+    either.
>+
>+    If there is no segment dumped into the DUMPFILE, the DUMPFILE can't be
>+    analysed by crash.
>--
>1.7.1
>
>
>_______________________________________________
>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] 4+ messages in thread

* Re: [PATCH] makedumpfile: Add description of incomplete dump file
  2014-11-13  9:01 ` Atsushi Kumagai
@ 2014-11-13  9:29   ` "Zhou, Wenjian/周文剑"
  2014-11-14  1:21     ` Atsushi Kumagai
  0 siblings, 1 reply; 4+ messages in thread
From: "Zhou, Wenjian/周文剑" @ 2014-11-13  9:29 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: kexec@lists.infradead.org

On 11/13/2014 05:01 PM, Atsushi Kumagai wrote:
> Hello Zhou,
>
>> Add description of incomplete elf and kdump-compressed dump file
>> in IMPLEMENTATION.
>
> That's a good idea, thanks Zhou.
> I have some comments.
>
>> Signed-off-by: Qiao Nuohan<qiaonuohan@cn.fujitsu.com>
>> Signed-off-by: Zhou Wenjian<zhouwj-fnst@cn.fujitsu.com>
>> ---
>> IMPLEMENTATION |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 files changed, 76 insertions(+), 0 deletions(-)
>>
>> diff --git a/IMPLEMENTATION b/IMPLEMENTATION
>> index 2f4cfd6..8f8a945 100644
>> --- a/IMPLEMENTATION
>> +++ b/IMPLEMENTATION
>> @@ -112,3 +112,79 @@
>>          unsigned long long      page_flags;     /* page flags */
>>      } page_desc_t;
>>
>> +* The incomplete DUMPFILE
>> +  When generating DUMPFILE, if ENOSPACE error happens, the DUMPFILE will be
>> +  incomplete.
>> +
>> +  - The incomplete kdump-compressed DUMPFILE
>> +
>> +           the complete                  the incomplete
>> +    +-----------------------+    +-----------------------+
>> +    |      main header      |    |      main header      |  have incomplete flag
>> +    |-----------------------+    |-----------------------+
>> +    |      sub header       |    |      sub header       |
>> +    |-----------------------+    |-----------------------+
>> +    |      1st-bitmap       |    |      1st-bitmap       |
>> +    |-----------------------+    |-----------------------+
>> +    |      2nd-bitmap       |    |      2nd-bitmap       |
>> +    |-----------------------+    |-----------------------+
>> +    | page header for pfn 0 |    | page header for pfn 0 |
>> +    | page header for pfn 1 |    | page header for pfn 1 |
>> +    |                  :    |    |                  :    |
>> +    | page header for pfn N |    | page header for pfn N |  The page headers after
>> +    |                  :    |    |                       |  N don't exist. The
>> +    | page header for pfn Z |    |                       |  value of it is zero,
>> +    |-----------------------|    |-----------------------|  when try to read it.
>> +    |   page data (pfn 0)   |    |   page data (pfn 0)   |
>> +    |   page data (pfn 1)   |    |   page data (pfn 1)   |
>> +    |                  :    |    |                  :    |
>> +    |   page data (pfn N)   |    |   page data (pfn N)   |
>> +    |                  :    |    +-----------------------+
>> +    |   page data (pfn Z)   |
>> +    +-----------------------+
>> +
>> +    The incomplete flag is set into status of disk_dump_header by
>> +                          status |= DUMP_DH_COMPRESSED_INCOMPLETE
>> +    DUMP_DH_COMPRESSED_INCOMPLETE : 0x8
>> +
>> +    The page header and page data are written in pairs. When writting page data
>
> s/writting/writing/
>
>> +    (pfn N+1), if ENOSPACE error happens, the page headers after N won't be
>> +    written either.
>> +
>> +    If there is no page data dumped into the DUMPFILE, the DUMPFILE can't be
>> +    analysed by crash.
>> +
>> +  - The incomplete elf DUMPFILE
>
> There is no description of the ELF format itself in this documentation
> unlike the kdump-compressed format, I would be glad if you could write it.
>
>> +
>> +      the complete          the incomplete
>> +    +-------------+         +-------------+
>> +    |  elf header |         |  elf header |  have incomplete flag
>> +    |-------------+         |-------------+
>> +    |  PT_NOTE    |         |  PT_NOTE    |
>> +    |  PT_LOAD(1) |         |  PT_LOAD(1) |
>> +    |         :   |         |         :   |
>> +    |  PT_LOAD(N) |         |  PT_LOAD(N) |  The PT_LOAD after N don't exist.
>> +    |         :   |         |             |  The value of it is zero, when try
>> +    |  PT_LOAD(Z) |         |             |  to read it.
>> +    |-------------+         |-------------+
>
> The whole program header must exist since reserve_diskspace()
> pre-allocates enough space for it, the description above isn't right.
>
The space exists, but since PT_LOAD and segment are written in pairs,
if ENOSPACE happens, the left PT_LOAD won't be generated and won't be
written as well. The space reserved is for the PT_LOAD still in buffer.

-- 
Thanks
Zhou Wenjian

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] makedumpfile: Add description of incomplete dump file
  2014-11-13  9:29   ` "Zhou, Wenjian/周文剑"
@ 2014-11-14  1:21     ` Atsushi Kumagai
  0 siblings, 0 replies; 4+ messages in thread
From: Atsushi Kumagai @ 2014-11-14  1:21 UTC (permalink / raw)
  To: zhouwj-fnst@cn.fujitsu.com; +Cc: kexec@lists.infradead.org

>On 11/13/2014 05:01 PM, Atsushi Kumagai wrote:
>> Hello Zhou,
>>
>>> Add description of incomplete elf and kdump-compressed dump file
>>> in IMPLEMENTATION.
>>
>> That's a good idea, thanks Zhou.
>> I have some comments.
>>
>>> Signed-off-by: Qiao Nuohan<qiaonuohan@cn.fujitsu.com>
>>> Signed-off-by: Zhou Wenjian<zhouwj-fnst@cn.fujitsu.com>
>>> ---
>>> IMPLEMENTATION |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> 1 files changed, 76 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/IMPLEMENTATION b/IMPLEMENTATION
>>> index 2f4cfd6..8f8a945 100644
>>> --- a/IMPLEMENTATION
>>> +++ b/IMPLEMENTATION
>>> @@ -112,3 +112,79 @@
>>>          unsigned long long      page_flags;     /* page flags */
>>>      } page_desc_t;
>>>
>>> +* The incomplete DUMPFILE
>>> +  When generating DUMPFILE, if ENOSPACE error happens, the DUMPFILE will be
>>> +  incomplete.
>>> +
>>> +  - The incomplete kdump-compressed DUMPFILE
>>> +
>>> +           the complete                  the incomplete
>>> +    +-----------------------+    +-----------------------+
>>> +    |      main header      |    |      main header      |  have incomplete flag
>>> +    |-----------------------+    |-----------------------+
>>> +    |      sub header       |    |      sub header       |
>>> +    |-----------------------+    |-----------------------+
>>> +    |      1st-bitmap       |    |      1st-bitmap       |
>>> +    |-----------------------+    |-----------------------+
>>> +    |      2nd-bitmap       |    |      2nd-bitmap       |
>>> +    |-----------------------+    |-----------------------+
>>> +    | page header for pfn 0 |    | page header for pfn 0 |
>>> +    | page header for pfn 1 |    | page header for pfn 1 |
>>> +    |                  :    |    |                  :    |
>>> +    | page header for pfn N |    | page header for pfn N |  The page headers after
>>> +    |                  :    |    |                       |  N don't exist. The
>>> +    | page header for pfn Z |    |                       |  value of it is zero,
>>> +    |-----------------------|    |-----------------------|  when try to read it.
>>> +    |   page data (pfn 0)   |    |   page data (pfn 0)   |
>>> +    |   page data (pfn 1)   |    |   page data (pfn 1)   |
>>> +    |                  :    |    |                  :    |
>>> +    |   page data (pfn N)   |    |   page data (pfn N)   |
>>> +    |                  :    |    +-----------------------+
>>> +    |   page data (pfn Z)   |
>>> +    +-----------------------+
>>> +
>>> +    The incomplete flag is set into status of disk_dump_header by
>>> +                          status |= DUMP_DH_COMPRESSED_INCOMPLETE
>>> +    DUMP_DH_COMPRESSED_INCOMPLETE : 0x8
>>> +
>>> +    The page header and page data are written in pairs. When writting page data
>>
>> s/writting/writing/
>>
>>> +    (pfn N+1), if ENOSPACE error happens, the page headers after N won't be
>>> +    written either.
>>> +
>>> +    If there is no page data dumped into the DUMPFILE, the DUMPFILE can't be
>>> +    analysed by crash.
>>> +
>>> +  - The incomplete elf DUMPFILE
>>
>> There is no description of the ELF format itself in this documentation
>> unlike the kdump-compressed format, I would be glad if you could write it.
>>
>>> +
>>> +      the complete          the incomplete
>>> +    +-------------+         +-------------+
>>> +    |  elf header |         |  elf header |  have incomplete flag
>>> +    |-------------+         |-------------+
>>> +    |  PT_NOTE    |         |  PT_NOTE    |
>>> +    |  PT_LOAD(1) |         |  PT_LOAD(1) |
>>> +    |         :   |         |         :   |
>>> +    |  PT_LOAD(N) |         |  PT_LOAD(N) |  The PT_LOAD after N don't exist.
>>> +    |         :   |         |             |  The value of it is zero, when try
>>> +    |  PT_LOAD(Z) |         |             |  to read it.
>>> +    |-------------+         |-------------+
>>
>> The whole program header must exist since reserve_diskspace()
>> pre-allocates enough space for it, the description above isn't right.
>>
>The space exists, but since PT_LOAD and segment are written in pairs,
>if ENOSPACE happens, the left PT_LOAD won't be generated and won't be
>written as well. The space reserved is for the PT_LOAD still in buffer.

Oh, it slipped my mind. You are right.


Thanks
Atsushi Kumagai

>--
>Thanks
>Zhou Wenjian
>
>_______________________________________________
>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] 4+ messages in thread

end of thread, other threads:[~2014-11-14  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  8:29 [PATCH] makedumpfile: Add description of incomplete dump file Zhou Wenjian
2014-11-13  9:01 ` Atsushi Kumagai
2014-11-13  9:29   ` "Zhou, Wenjian/周文剑"
2014-11-14  1:21     ` Atsushi Kumagai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox