From owner-svn-src-all@freebsd.org Thu Oct 17 18:29:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8988015A7FA; Thu, 17 Oct 2019 18:29:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46vHkx34MXz4Xvl; Thu, 17 Oct 2019 18:29:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DC1E2485E; Thu, 17 Oct 2019 18:29:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9HITjfG058650; Thu, 17 Oct 2019 18:29:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9HITiHg058649; Thu, 17 Oct 2019 18:29:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910171829.x9HITiHg058649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 17 Oct 2019 18:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353690 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 353690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2019 18:29:45 -0000 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);