Author: cem Date: Thu Oct 17 18:29:44 2019 New Revision: 353690 URL: https://svnweb.freebsd.org/changeset/base/353690
Log: Add a very limited DDB dumpon(8)-alike to MI dumper code This allows ddb(4) commands to construct a static dumperinfo during panic/debug and invoke doadump(false) using the provided dumper configuration (always inserted first in the list). The intended usecase is a ddb(4)-time netdump(4) command. Reviewed by: markj (earlier version) Differential Revision: https://reviews.freebsd.org/D21448 Modified: head/sys/kern/kern_shutdown.c head/sys/sys/conf.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Oct 17 17:48:32 2019 (r353689) +++ head/sys/kern/kern_shutdown.c Thu Oct 17 18:29:44 2019 (r353690) @@ -1267,6 +1267,20 @@ cleanup: return (error); } +#ifdef DDB +void +dumper_ddb_insert(struct dumperinfo *newdi) +{ + TAILQ_INSERT_HEAD(&dumper_configs, newdi, di_next); +} + +void +dumper_ddb_remove(struct dumperinfo *di) +{ + TAILQ_REMOVE(&dumper_configs, di, di_next); +} +#endif + static bool dumper_config_match(const struct dumperinfo *di, const char *devname, const struct diocskerneldump_arg *kda) Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Thu Oct 17 17:48:32 2019 (r353689) +++ head/sys/sys/conf.h Thu Oct 17 18:29:44 2019 (r353690) @@ -366,6 +366,10 @@ int dumper_insert(const struct dumperinfo *di_template const struct diocskerneldump_arg *kda); int dumper_remove(const char *devname, const struct diocskerneldump_arg *kda); +/* For ddb(4)-time use only. */ +void dumper_ddb_insert(struct dumperinfo *); +void dumper_ddb_remove(struct dumperinfo *); + int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh); int dump_append(struct dumperinfo *, void *, vm_offset_t, size_t); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"