Does FreeBSD support sparse kernel crash dumps?

Dan Nelson dnelson at allantgroup.com
Sat Apr 8 08:17:44 UTC 2006


In the last episode (Apr 07), Peter Wemm said:
> On Friday 07 April 2006 04:01 pm, Paul Marciano wrote:
> > Do you compress the data stream at all (e.g. gzip)?
> 
> No, but it could be done in theory.. if you were willing to set aside
> some memory for the compression algorithm to use.  Or just do some
> sort of simple compression (run length encoding?) The problem is that
> the dump code cannot allocate memory after the machine has crashed. 
> It has to be able to run as isolated from the rest of the kernel as
> possible in order to give a true snapshot of the undisturbed state.

This is pretty easy since zlib lets you pass in your own malloc/free
functions.  It's sufficient to pre-malloc (or simply statically
declare) a 128k block of memory, then dole it out with a simple
function that returns high_water+=asked_for_size until you get a
request that would push highwater over 128k.  A patch that does this
for 5.* on x86 only is at
http://www.allantgroup.com/FreeBSD/crashdump_compress.diff .

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list