Lines Matching +full:capture +full:- +full:only

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
30 * DDB capture support: capture kernel debugger output into a fixed-size
52 * While it would be desirable to use a small block-sized buffer and dump
53 * incrementally to disk in fixed-size blocks, it's not possible to enter
62 static MALLOC_DEFINE(M_DDB_CAPTURE, "ddb_capture", "DDB capture buffer");
74 static u_int db_capture_maxbufsize = DDB_CAPTURE_MAXBUFSIZE; /* Read-only. */
77 static int db_capture_inpager; /* Suspend capture in pager. */
78 static int db_capture_inprogress; /* DDB capture currently in progress. */
83 static SYSCTL_NODE(_debug_ddb, OID_AUTO, capture,
85 "DDB capture options");
88 &db_capture_bufoff, 0, "Bytes of data in DDB capture buffer");
92 "Maximum value for debug.ddb.capture.bufsize");
95 &db_capture_inprogress, 0, "DDB output capture in progress");
98 * Boot-time allocation of the DDB capture buffer, if any. Force all buffer
105 TUNABLE_INT_FETCH("debug.ddb.capture.bufsize", &db_capture_bufsize); in db_capture_sysinit()
119 * Run-time adjustment of the capture buffer.
130 if (error || req->newptr == NULL) in sysctl_debug_ddb_capture_bufsize()
170 "Size of DDB capture buffer");
173 * Sysctl to read out the capture buffer from userspace. We require
182 error = priv_check(req->td, PRIV_DDB_CAPTURE); in sysctl_debug_ddb_capture_data()
197 "DDB capture data");
200 * Routines for capturing DDB output into a fixed-size buffer. These are
211 len = min(buflen, db_capture_bufsize - db_capture_bufoff); in db_capture_write()
241 * Zero out any bytes left in the last block of the DDB capture buffer. This
243 * capture is stopped, in order to avoid injecting nul's into the middle of
251 len = min(TEXTDUMP_BLOCKSIZE, (db_capture_bufsize - in db_capture_zeropad()
258 * Reset capture state, which flushes buffers.
270 * Start capture. Only one session is allowed at any time, but we may
278 db_printf("Capture already started\n"); in db_capture_start()
285 * Terminate DDB output capture--real work is deferred to db_capture_dump,
287 * capture may be started again before the dump takes place.
294 db_printf("Capture not started\n"); in db_capture_stop()
301 * Dump DDB(4) captured output (and resets capture buffers).
322 /*-
323 * DDB(4) command to manage capture:
325 * capture on - start DDB output capture
326 * capture off - stop DDB output capture
327 * capture reset - reset DDB capture buffer (also stops capture)
328 * capture status - print DDB output capture status
334 db_error("capture [on|off|reset|status]\n"); in db_capture_usage()
359 db_printf("capture is on\n"); in db_capture_cmd()
361 db_printf("capture is off\n"); in db_capture_cmd()