xref: /freebsd/share/man/man4/textdump.4 (revision f5ccc06760b569ab35a91d1edc8b90d425db26a9)
10ff94fb6SRobert Watson.\"
20ff94fb6SRobert Watson.\" Copyright (c) 2007 Robert N. M. Watson
30ff94fb6SRobert Watson.\" All rights reserved.
40ff94fb6SRobert Watson.\"
50ff94fb6SRobert Watson.\" Redistribution and use in source and binary forms, with or without
60ff94fb6SRobert Watson.\" modification, are permitted provided that the following conditions
70ff94fb6SRobert Watson.\" are met:
80ff94fb6SRobert Watson.\" 1. Redistributions of source code must retain the above copyright
90ff94fb6SRobert Watson.\"    notice(s), this list of conditions and the following disclaimer as
100ff94fb6SRobert Watson.\"    the first lines of this file unmodified other than the possible
110ff94fb6SRobert Watson.\"    addition of one or more copyright notices.
120ff94fb6SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
130ff94fb6SRobert Watson.\"    notice(s), this list of conditions and the following disclaimer in the
140ff94fb6SRobert Watson.\"    documentation and/or other materials provided with the distribution.
150ff94fb6SRobert Watson.\"
160ff94fb6SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
170ff94fb6SRobert Watson.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
180ff94fb6SRobert Watson.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
190ff94fb6SRobert Watson.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
200ff94fb6SRobert Watson.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
210ff94fb6SRobert Watson.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
220ff94fb6SRobert Watson.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
230ff94fb6SRobert Watson.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240ff94fb6SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250ff94fb6SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
260ff94fb6SRobert Watson.\" DAMAGE.
270ff94fb6SRobert Watson.\"
280ff94fb6SRobert Watson.\" $FreeBSD$
290ff94fb6SRobert Watson.\"
30f5ccc067SRobert Watson.Dd 26 December, 2007
310ff94fb6SRobert Watson.Dt textdump 4
320ff94fb6SRobert Watson.Os
330ff94fb6SRobert Watson.Sh NAME
340ff94fb6SRobert Watson.Nm textdump
350ff94fb6SRobert Watson.Nd textdump kernel dumping facility
360ff94fb6SRobert Watson.Sh SYNOPSIS
370ff94fb6SRobert Watson.Cd options KDB
380ff94fb6SRobert Watson.Cd options DDB
390ff94fb6SRobert Watson.Sh DESCRIPTION
400ff94fb6SRobert WatsonThe
410ff94fb6SRobert Watson.Nm
420ff94fb6SRobert Watsonfacility allows the capture of kernel debugging information to disk in a
430ff94fb6SRobert Watsonhuman-readable rather than the machine-readable form normally used with
440ff94fb6SRobert Watsonkernel memory dumps and minidumps.
450ff94fb6SRobert WatsonThis representation, while less complete in that it does not capture full
460ff94fb6SRobert Watsonkernel state, can provide debugging information in a more compact, portable,
470ff94fb6SRobert Watsonand persistent form than a traditional dump.
480ff94fb6SRobert WatsonBy combining
490ff94fb6SRobert Watson.Nm
500ff94fb6SRobert Watsonwith other
510ff94fb6SRobert Watson.Xr DDB 4
520ff94fb6SRobert Watsonfacilities, such as scripting and output capture, detailed bug information
530ff94fb6SRobert Watsoncan be captured in a fully automated manner.
540ff94fb6SRobert Watson.Sh FORMAT
550ff94fb6SRobert Watson.Nm
560ff94fb6SRobert Watsondata is stored in a dump partition in the same style as a regular memory
570ff94fb6SRobert Watsondump, and will be automatically extracted by
580ff94fb6SRobert Watson.Xr savecore 8
590ff94fb6SRobert Watsonif present on boot.
600ff94fb6SRobert Watson.Pp
610ff94fb6SRobert Watson.Nm
620ff94fb6SRobert Watsonfiles are stored in the
630ff94fb6SRobert Watson.Xr tar 5
640ff94fb6SRobert Watsonformat, and consist of one or more text files, each storing a particular type
650ff94fb6SRobert Watsonof debugging output.
660ff94fb6SRobert WatsonThe following parts may be present:
670ff94fb6SRobert Watson.Bl -tag -width version.txt
680ff94fb6SRobert Watson.It Pa ddb.txt
690ff94fb6SRobert WatsonCaptured
700ff94fb6SRobert Watson.Xr DDB 4
710ff94fb6SRobert Watsonoutput, if the capture facility has been used.
720ff94fb6SRobert WatsonMay be disabled by clearing the
730ff94fb6SRobert Watson.Dv debug.ddb.textdump.do_ddb
740ff94fb6SRobert Watsonsysctl.
750ff94fb6SRobert Watson.It Pa config.txt
760ff94fb6SRobert WatsonKernel configuration, if
770ff94fb6SRobert Watson.Od options INCLUDE_CONFIG_FILE
780ff94fb6SRobert Watsonhas been compiled into the kernel.
790ff94fb6SRobert WatsonMay be disabled by clearing the
800ff94fb6SRobert Watson.Dv debug.ddb.textdump.do_config
810ff94fb6SRobert Watsonsysctl.
820ff94fb6SRobert Watson.It Pa msgbuf.txt
830ff94fb6SRobert WatsonKernel message buffer, including recent console output if the capture
840ff94fb6SRobert Watsonfacility has been used.
850ff94fb6SRobert WatsonMay be disabled by clearing the
860ff94fb6SRobert Watson.Dv debug.ddb.textdump.do_msgbuf
870ff94fb6SRobert Watsonsysctl.
880ff94fb6SRobert Watson.It Pa panic.txt
890ff94fb6SRobert WatsonKernel panic string, if the kernel panicked before the dump was generated.
900ff94fb6SRobert WatsonMay be disabled by clearing the
910ff94fb6SRobert Watson.Dv debug.ddb.textdump.do_panic
920ff94fb6SRobert Watsonsysctl.
930ff94fb6SRobert Watson.It Pa version.txt
940ff94fb6SRobert WatsonKernel version string.
950ff94fb6SRobert WatsonMy be disabled by clearing the
960ff94fb6SRobert Watson.Dv dbeug.ddb.textdump.do_panic
970ff94fb6SRobert Watsonsysctl.
980ff94fb6SRobert Watson.El
990ff94fb6SRobert Watson.Pp
1000ff94fb6SRobert WatsonKernel textdumps may be extracted using
1010ff94fb6SRobert Watson.Xr bsdtar 1 .
1020ff94fb6SRobert Watson.Sh CONFIGURATION
1030ff94fb6SRobert WatsonThe
1040ff94fb6SRobert Watson.Nm
1050ff94fb6SRobert Watsonfacility is enabled as part of the kernel debugger using
1060ff94fb6SRobert Watson.Cd options KDB
1070ff94fb6SRobert Watsonand
1080ff94fb6SRobert Watson.Cd options DDB .
1090ff94fb6SRobert WatsonBy default, kernel dumps generated on panic or via explicit requests for a
1100ff94fb6SRobert Watsondump will be regular memory dumps; however, by using the
1110ff94fb6SRobert Watson.Ic textdump set
1120ff94fb6SRobert Watsoncommand in
1130ff94fb6SRobert Watson.Xr DDB 4 ,
1140ff94fb6SRobert Watsonor by setting the
1150ff94fb6SRobert Watson.Dv debug.ddb.textdump.pending
1160ff94fb6SRobert Watsonsysctl to 1 using
1170ff94fb6SRobert Watson.Xr sysctl 8 ,
1180ff94fb6SRobert Watsonit is possible to request that the next dump be a textdump.
1190ff94fb6SRobert Watson.Pp
1200ff94fb6SRobert WatsonIf at the
1210ff94fb6SRobert Watson.Xr DDB 4
1220ff94fb6SRobert Watsoncommand line, the commands
1230ff94fb6SRobert Watson.Ic textdump set ,
1240ff94fb6SRobert Watson.Ic textdump status ,
1250ff94fb6SRobert Watsonand
1260ff94fb6SRobert Watson.Ic textdump unset
1270ff94fb6SRobert Watsonmay be used to set, query, and clear the textdump pending flag.
1280ff94fb6SRobert Watson.Pp
1290ff94fb6SRobert WatsonAs with regular kernel dumps, a dump partition must be automatically or
1300ff94fb6SRobert Watsonmanually configured using
1310ff94fb6SRobert Watson.Xr dumpon 8 .
1320ff94fb6SRobert Watson.Sh EXAMPLES
1330ff94fb6SRobert WatsonIn the following example, the script
1340ff94fb6SRobert Watson.Dv kdb.enter.panic
1350ff94fb6SRobert Watsonwill run when the kernel debugger is entered as a result of a panic, enable
1360ff94fb6SRobert Watsonoutput capture, dump several useful pieces of debugging information, and then
1370ff94fb6SRobert Watsoninvoke panic in order to force a kernel dump to be written out followed by a
1380ff94fb6SRobert Watsonreboot:
1390ff94fb6SRobert Watson.Bd -literal -offset indent
140f5ccc067SRobert Watsonscript kdb.enter.panic=textdump set; capture on; show allpcpu; bt;
141f5ccc067SRobert Watson  ps; alltrace; show alllock; call doadump; reset
1420ff94fb6SRobert Watson.Ed
1430ff94fb6SRobert Watson.Pp
1440ff94fb6SRobert WatsonIn the following example, the script
1450ff94fb6SRobert Watson.Dv kdb.enter.witness
1460ff94fb6SRobert Watsonwill run when the kernel debugger is entered as a result of a witness
1470ff94fb6SRobert Watsonviolation, printing lock-related information for the user:
1480ff94fb6SRobert Watson.Bd -literal -offset indent
1490ff94fb6SRobert Watsonscript kdb.enter.witness=show locks
1500ff94fb6SRobert Watson.Ed
1510ff94fb6SRobert Watson.Sh SEE ALSO
1520ff94fb6SRobert Watson.Xr bsdtar 1 ,
1530ff94fb6SRobert Watson.Xr ddb 4 ,
1540ff94fb6SRobert Watson.Xr tar 5 ,
1550ff94fb6SRobert Watson.Xr dumpon 8 ,
1560ff94fb6SRobert Watson.Xr savecore 8 ,
1570ff94fb6SRobert Watson.Xr sysctl 8
1580ff94fb6SRobert Watson.Sh AUTHORS
1590ff94fb6SRobert WatsonThe
1600ff94fb6SRobert Watson.Nm
1610ff94fb6SRobert Watsonfacility was created by
1620ff94fb6SRobert Watson.An Robert N. M. Watson .
163