TEXTDUMP(4)
πΎ TEXTDUMP(4) πΎ
okay bestie, gather round, because this one is the Kernel Interfaces Manual page for textdump β the textdump kernel dumping facility β and it is genuinely one of the most underrated little divas in the whole tree. no cap. π«Ά
β¨ NAME β¨
textdump β textdump kernel dumping facility
πΈ SYNOPSIS πΈ
options DDB
options KDB
options TEXTDUMP_PREFERRED
options TEXTDUMP_VERBOSE
π¦ DESCRIPTION π¦
so like. when your kernel does a little oopsie and needs to spill its guts, the normal move is a memory dump or minidump β very machine-readable, very "here's a wall of raw bytes, good luck boo". The textdump facility says not today and instead captures kernel debugging information to disk in a human-readable form instead. π
and yeah, this representation is less complete β it doesn't capture the full kernel state, we're not pretending otherwise β but the tradeoff is chef's kiss: it gives you debugging info in a form that's more compact, more portable, and more persistent than a traditional dump. π
and here's the iconic part: by combining textdump with other ddb(4) facilities β think scripting and output capture β you can capture detailed bug information in a fully automated manner. it's giving main character energy fr fr. β¨
π FORMAT π
textdump data is stored in a dump partition in the same style as a regular memory dump, and it will be automatically extracted by savecore(8) if present on boot. automatic. we love a self-sufficient queen. π
textdump files are stored in the tar(5) format, and they consist of one or more text files, each one storing a particular type of debugging output. the following parts may be present:
ddb.txtβ Capturedddb(4)output, if the capture facility has been used. May be disabled by clearing thedebug.ddb.textdump.do_ddbsysctl.config.txtβ Kernel configuration, ifoptions INCLUDE_CONFIG_FILEhas been compiled into the kernel. May be disabled by clearing thedebug.ddb.textdump.do_configsysctl.msgbuf.txtβ Kernel message buffer, including recent console output if the capture facility has been used. May be disabled by clearing thedebug.ddb.textdump.do_msgbufsysctl.panic.txtβ Kernel panic string, if the kernel panicked before the dump was generated. May be disabled by clearing thedebug.ddb.textdump.do_panicsysctl.version.txtβ Kernel version string. My be disabled by clearing thedebug.ddb.textdump.do_versionsysctl.
(and yes, that "My be disabled" typo in version.txt is in the original, we're keeping it, it's part of the lore now π)
Kernel textdumps may be extracted using tar(1). π§
π CONFIGURATION π
The textdump facility is enabled as part of the kernel debugger using options KDB and options DDB.
By default, kernel dumps generated on panic or via explicit requests for a dump will be regular memory dumps. however β plot twist β by using the textdump set command in ddb(4), or by setting the debug.ddb.textdump.pending sysctl to 1 using sysctl(8), you can request that the next dump be a textdump instead. you can also directly trigger a textdump in ddb(4) by running the command textdump dump. periodt. π
If you're at the ddb(4) command line, the commands textdump set, textdump status, and textdump unset may be used to set, query, and clear the textdump pending flag. set, status, unset β the holy trinity bestie. π«Ά
As with regular kernel dumps, a dump partition must be automatically or manually configured using dumpon(8).
Additional kernel config(8) options:
TEXTDUMP_PREFERREDβ sets textdumps to be the default manner of doing dumps. This means there will be no need tosysctl(8)or use thetextdump setddb(8)commands. she just does it by default now, iconic behaviour honestly πTEXTDUMP_VERBOSEβ will have the textdump facility be more verbose about each file it is emitting, as well as other diagnostics useful to debug the textdump facility itself. yapper mode: enabled π£οΈβ¨
π₯ EXAMPLES π₯
In the following example, the script kdb.enter.panic will run when the kernel debugger is entered as a result of a panic, enable output capture, dump several useful pieces of debugging information, and then invoke panic in order to force a kernel dump to be written out followed by a reboot:
script kdb.enter.panic=textdump set; capture on; show allpcpu; bt;
ps; alltrace; show alllocks; textdump dump; reset
In the following example, the script kdb.enter.witness will run when the kernel debugger is entered as a result of a witness violation, printing lock-related information for the user:
script kdb.enter.witness=show locks
These scripts may also be configured using the ddb(8) utility. π οΈ
π SEE ALSO π
tar(1), ddb(4), tar(5), ddb(8), dumpon(8), savecore(8), sysctl(8)
π HISTORY π
The textdump facility first appeared in FreeBSD 7.1.
π AUTHORS π
The textdump facility was created by Robert N. M. Watson.
lowkey obsessed with whoever decided kernel debugging info deserved to be readable. go off king π«‘
and that's the whole page bestie!! this lil baddie is coming to you straight from the Debian build of the manual, dated October 18, 2019. go forth and textdump set responsibly. mwah ππΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2007 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms