From owner-freebsd-questions@FreeBSD.ORG Sat Apr 8 08:17:44 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BB2D16A400 for ; Sat, 8 Apr 2006 08:17:44 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EE7F43D45 for ; Sat, 8 Apr 2006 08:17:43 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.4) id k388Hc42042487; Sat, 8 Apr 2006 03:17:38 -0500 (CDT) (envelope-from dan) Date: Sat, 8 Apr 2006 03:17:38 -0500 From: Dan Nelson To: Peter Wemm Message-ID: <20060408081737.GH5697@dan.emsphone.com> References: <20060407230152.57316.qmail@web54004.mail.yahoo.com> <200604072228.12452.peter@wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200604072228.12452.peter@wemm.org> X-OS: FreeBSD 5.5-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: Paul Marciano , freebsd-questions@freebsd.org Subject: Re: Does FreeBSD support sparse kernel crash dumps? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2006 08:17:44 -0000 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@allantgroup.com