Re: handling missing kdump pages in diskdump format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2007-03-01 at 21:15 +0900, Ken'ichi Ohmichi wrote:
> (added Vivek Goyal)
> (added redhat-kexec-kdump-ml)
> 
> Hi everyone,
> 
> If Bob's proposal (the end of this mail) is merged into makedumpfile,
> the analysis behavior of ELF dumpfile is different from kdump-compressed
> dumpfile's as follows.
> When reading ELF dumpfile, the crash utility treats the excluded pages
> as zero-filled pages. But, as to kdump-compressed dumpfile, the crash
> utility will display the warning message to mean "These pages are
> excluded by partial dump" when it accesses the excluded pages.

Actually, changing makedumpfile doesn't change any analysis behavior.
It just makes makedumpfile follow a new rule that omitted pages are
omitted only because they are a certain type of page, instead of being
omitted because they contain all zeros. 

The change in analysis behavior requires a change to crash.  Basically,
I'd like crash to say "I don't know what is at that address" when it
doesn't have the page in the dump instead of "That address contains a
zero and it might be because it really was a zero and it might be
because I don't what was there".

Attached is a patch for crash (3.19) that causes it to quit providing
zero'd pages for pages omitted from a KDUMP-style diskdump dumpfile.
Note that this patch preserves the old behavior for DISKDUMP dumpfiles.
(copied here for quick reference)

--- crash-4.0-3.19/diskdump.c	2007-02-07 11:49:15.000000000 -0700
+++ crash-4.0-3.19.bobm/diskdump.c	2007-03-01 11:06:54.000000000 -0700
@@ -452,6 +452,8 @@ read_diskdump(int fd, void *bufptr, int 
 	if ((pfn >= dd->header->max_mapnr) || !page_is_ram(pfn))
 		return SEEK_ERROR;
 	if (!page_is_dumpable(pfn)) {
+		if (dd->flags & KDUMP_CMPRS_LOCAL)
+			return SEEK_ERROR;
 		memset(bufptr, 0, cnt);
 		return cnt;
 	}


If a user has old KDUMP dumpfiles generated by a version of makedumpfile
that omits zero pages and wants to continue to debug with them, one
workaround is to "fix" those dumpfiles to work with this newer version
of crash by changing the first 8 bytes of the dumpfile from:

   "KDUMP   "
to 
   "DISKDUMP"

Otherwise, crash would either need a command line option to allow it to
function with old zero-excluded makedumpfile dumps, or we would need to
distinguish the zero-fill rule in the dumpfile header ("KDUMP   " ->
"KDUMP-NZ ") perhaps?

I will take a look at the behavior of crash on ELF format dumpfiles next
week.


Thanks for considering,
Bob Montgomery






--- crash-4.0-3.19/diskdump.c	2007-02-07 11:49:15.000000000 -0700
+++ crash-4.0-3.19.bobm/diskdump.c	2007-03-01 11:06:54.000000000 -0700
@@ -452,6 +452,8 @@ read_diskdump(int fd, void *bufptr, int 
 	if ((pfn >= dd->header->max_mapnr) || !page_is_ram(pfn))
 		return SEEK_ERROR;
 	if (!page_is_dumpable(pfn)) {
+		if (dd->flags & KDUMP_CMPRS_LOCAL)
+			return SEEK_ERROR;
 		memset(bufptr, 0, cnt);
 		return cnt;
 	}
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux