Hi Bob,
2007/03/01 12:36:01 -0700, Bob Montgomery <bob.montgomery(a)hp.com> wrote:
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;
}
In the above patch, a user cannot distinguish between the original
unaccessable pages and the excluded pages.
I think that the crash utility should display the warning message
to mean "These pages are excluded by partial dump" when it accesses
the excluded pages.
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?
The existing crash cannot read a dumpfile which signature is "KDUMP-NZ ".
I think it is good that disk_dump_header.header_version will be changed
from 0 into 1. The existing crash doesn't check header_version.
If the existing crash tries to read a new dumpfile (header_version==1),
it considers the excluded pages as the zero-filled pages and it can
read a new dumpfile, and a new crash can distinguish the excluded pages.
For the above, I created the attached patch (for makedumpfile-1.1.1).
Could you say the opinion ?
I will take a look at the behavior of crash on ELF format dumpfiles
next
week.
I appreciate your work.
Thanks
Ken'ichi Ohmichi