From owner-cvs-src@FreeBSD.ORG Wed Dec 26 11:32:33 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9843E16A419; Wed, 26 Dec 2007 11:32:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5A913C461; Wed, 26 Dec 2007 11:32:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBQBWXiH092734; Wed, 26 Dec 2007 11:32:33 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBQBWXnU092733; Wed, 26 Dec 2007 11:32:33 GMT (envelope-from rwatson) Message-Id: <200712261132.lBQBWXnU092733@repoman.freebsd.org> From: Robert Watson Date: Wed, 26 Dec 2007 11:32:33 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/conf files src/sys/ddb db_capture.c db_command.c db_textdump.c ddb.h src/sys/kern kern_shutdown.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 11:32:33 -0000 rwatson 2007-12-26 11:32:33 UTC FreeBSD src repository Modified files: sys/conf files sys/ddb db_capture.c db_command.c ddb.h sys/kern kern_shutdown.c Added files: sys/ddb db_textdump.c Log: Add textdump(4) facility, which provides an alternative form of kernel dump using mechanically generated/extracted debugging output rather than a simple memory dump. Current sources of debugging output are: - DDB output capture buffer, if there is captured output to save - Kernel message buffer - Kernel configuration, if included in kernel - Kernel version string - Panic message Textdumps are stored in swap/dump partitions as with regular dumps, but are laid out as ustar files in order to allow multiple parts to be stored as a stream of sequentially written blocks. Blocks are written out in reverse order, as the size of a textdump isn't known a priori. As with regular dumps, they will be extracted using savecore(8). One new DDB(4) command is added, "textdump", which accepts "set", "unset", and "status" arguments. By default, normal kernel dumps are generated unless "textdump set" is run in order to schedule a textdump. It can be canceled using "textdump unset" to restore generation of a normal kernel dump. Several sysctls exist to configure aspects of textdumps; debug.ddb.textdump.pending can be set to check whether a textdump is pending, or set/unset in order to control whether the next kernel dump will be a textdump from userspace. While textdumps don't have to be generated as a result of a DDB script run automatically as part of a kernel panic, this is a particular useful way to use them, as instead of generating a complete memory dump, a simple transcript of an automated DDB session can be captured using the DDB output capture and textdump facilities. This can be used to generate quite brief kernel bug reports rich in debugging information but not dependent on kernel symbol tables or precisely synchronized source code. Most textdumps I generate are less than 100k including the full message buffer. Using textdumps with an interactive debugging session is also useful, with capture being enabled/disabled in order to record some but not all of the DDB session. MFC after: 3 months Revision Changes Path 1.1260 +1 -0 src/sys/conf/files 1.2 +55 -3 src/sys/ddb/db_capture.c 1.76 +1 -0 src/sys/ddb/db_command.c 1.1 +555 -0 src/sys/ddb/db_textdump.c (new) 1.46 +23 -0 src/sys/ddb/ddb.h 1.187 +9 -1 src/sys/kern/kern_shutdown.c