freebsd-dev/sys/ddb
Robert Watson 618c7db30a 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
2007-12-26 11:32:33 +00:00
..
db_access.c Fix -Wundef. 2005-12-04 02:12:43 +00:00
db_access.h Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_break.c Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_break.h Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_capture.c Add textdump(4) facility, which provides an alternative form of kernel 2007-12-26 11:32:33 +00:00
db_command.c Add textdump(4) facility, which provides an alternative form of kernel 2007-12-26 11:32:33 +00:00
db_command.h Add a simple scripting facility to DDB(4), allowing the user to 2007-12-26 09:33:19 +00:00
db_examine.c Make the examine command honor db_pager_quit so you can use 'q' or 'x' 2007-10-27 20:19:11 +00:00
db_expr.c Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_input.c Add a new DDB(4) facility, output capture. Input and output from DDB may be 2007-12-25 23:06:51 +00:00
db_lex.c Add a simple scripting facility to DDB(4), allowing the user to 2007-12-26 09:33:19 +00:00
db_lex.h Add a simple scripting facility to DDB(4), allowing the user to 2007-12-26 09:33:19 +00:00
db_main.c Add a simple scripting facility to DDB(4), allowing the user to 2007-12-26 09:33:19 +00:00
db_output.c Add a new DDB(4) facility, output capture. Input and output from DDB may be 2007-12-25 23:06:51 +00:00
db_output.h Fixed formatting of printing of command tables. WIth the default max 2006-10-08 18:15:08 +00:00
db_print.c rev 1.54 of i386/include/pcb.h depended on sys/proc.h. The prerequisite 2005-04-14 05:25:40 +00:00
db_ps.c Print the stack bounds of the thread. 2007-10-16 17:52:59 +00:00
db_run.c rev 1.54 of i386/include/pcb.h depended on sys/proc.h. The prerequisite 2005-04-14 05:25:40 +00:00
db_script.c Remove duplicate $FreeBSD$ that snuck in. 2007-12-26 10:51:07 +00:00
db_sym.c Never zero-out db_last_symtab. Whan backtraces are done 2006-06-16 16:17:52 +00:00
db_sym.h Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_textdump.c Add textdump(4) facility, which provides an alternative form of kernel 2007-12-26 11:32:33 +00:00
db_thread.c Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form. 2007-01-17 15:05:52 +00:00
db_variables.c Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_variables.h Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_watch.c Fix the output format of MI ddb watches in 'show watch' on 64-bit 2006-11-17 16:41:56 +00:00
db_watch.h Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
db_write_cmd.c Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
ddb.h Add textdump(4) facility, which provides an alternative form of kernel 2007-12-26 11:32:33 +00:00