From nobody Tue Apr 12 09:35:23 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 35F1911DC226; Tue, 12 Apr 2022 09:35:24 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kd0vJ15BTz3m5d; Tue, 12 Apr 2022 09:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649756124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yva394G3Wtqjvn2Y7vqYLZ517rXvP+JFqtb3PIHkbXo=; b=Ks+xXc8xI0gdaFCq8FDYthMsHYPoPKx6tJAB69uUUu+ssXlF7c+COrW+FQry4MbSZ+mrNk 2RUgCW/AUjffLEWt+chxMhh+0gNVb98KXvqPT6rRnZs4CrcE35fgrImISqHmCLtSr9YBGL sgVMIBJfn50a8ccyltysAxlwwnL7igLFPVCm6ruU6GYy1k8bMfam4tG/QYHuU+6qcC+IWD HaA1K0NcDan32AzrxanXpWnb9w+yROHN+2W3pWJFrUsbBMx+RW0ErCzpncFfuoLUjRlKnB XspwJ6lQjsNvoA64O4pI5usC+8SaWkTn/+/ZJMptMLobh791HCkqSCvjHY+hKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01B0E15109; Tue, 12 Apr 2022 09:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23C9ZNW8033966; Tue, 12 Apr 2022 09:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23C9ZNhj033965; Tue, 12 Apr 2022 09:35:23 GMT (envelope-from git) Date: Tue, 12 Apr 2022 09:35:23 GMT Message-Id: <202204120935.23C9ZNhj033965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 1ea833a57290 - main - kdb: set kdb_why when entered via reboot and panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ea833a57290e04a5dfa8eebd6d4fa28204a807b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649756124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yva394G3Wtqjvn2Y7vqYLZ517rXvP+JFqtb3PIHkbXo=; b=cv5flh1zlrG7umxwyJRZZmWClqHGS5bd3KL+3T2igftJZJJiHfijuL9gashtsqLJ7GAk+H bEztNrIadMiB3xqEtgsgGZV2qVXk1lO1SibNIVVFod5f8ztuTFFG264tWAxQthyoQ7pooM iYCtKQmFF3ak5w78fkn2zEg2XCoai4Z9jnMbYPgCPzsxnJb96JsguPJQkS2qFcZXyPG3Jn a1/i+Zw0sjEoFyRjRlH9J65+QmnZ5I5PanMCylCtoaMRpHZ7tgS/1r7NGL7+o7K3KcW8zC 9xyBx6L2S6ERiCseCZC7TVOkgKQez10wOjNmg5Oid07rvHveenv1homRZkM3uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649756124; a=rsa-sha256; cv=none; b=JsPul249OgSJ6Kr073ShI2+i5W7HUJB58Cw5lnLHaPxZhfmLXMz/rNmXGRJRAoz5696Pyz fgBXB7987CCBD7E2Ow9KkA7i9qpAjOnJlwZOvMrp9gCkNr8djSv4wWXewUAsboDXPkhGjo JNlU1untgx2pjCrkOthrH1PU8khoaQRNSlUBgvOYkjwca12iTMR1C6EebsWelDZuqSXxiQ s5J9OtxshlYPNlyY+RY9WtzPqgniqN+otfVyfPv01NoTIIdBA9a8wsIDk5dRtVwBOBW8lP vcMIg3UVZrRpadrWCZ1tBqv7krDz7ctupctBhYsS0PAIZV/GDP1kVNGk+ffo4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=1ea833a57290e04a5dfa8eebd6d4fa28204a807b commit 1ea833a57290e04a5dfa8eebd6d4fa28204a807b Author: Tom Jones AuthorDate: 2022-04-12 09:30:22 +0000 Commit: Tom Jones CommitDate: 2022-04-12 09:34:40 +0000 kdb: set kdb_why when entered via reboot and panic Reviewed by: jhb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #74 Differential Revision: https://reviews.freebsd.org/D34551 --- sys/kern/subr_kdb.c | 4 +++- sys/sys/kdb.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index b189fe303e0f..6aa8bd17e048 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -292,6 +292,7 @@ void kdb_panic(const char *msg) { + kdb_why = KDB_WHY_PANIC; printf("KDB: panic\n"); panic("%s", msg); } @@ -300,6 +301,7 @@ void kdb_reboot(void) { + kdb_why = KDB_WHY_REBOOT; printf("KDB: reboot requested\n"); shutdown_nice(0); } @@ -498,9 +500,9 @@ kdb_enter(const char *why, const char *msg) { if (kdb_dbbe != NULL && kdb_active == 0) { + kdb_why = why; if (msg != NULL) printf("KDB: enter: %s\n", msg); - kdb_why = why; breakpoint(); kdb_why = KDB_WHY_UNSET; } diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h index 746abb0ee4f4..4669a3f9f551 100644 --- a/sys/sys/kdb.h +++ b/sys/sys/kdb.h @@ -121,6 +121,7 @@ extern const char * volatile kdb_why; #define KDB_WHY_POWERPC "powerpc" /* Unhandled powerpc intr. */ #define KDB_WHY_UNIONFS "unionfs" /* Unionfs bug. */ #define KDB_WHY_DTRACE "dtrace" /* DTrace action entered debugger. */ +#define KDB_WHY_REBOOT "reboot" /* reboot was requested. */ /* Return values for kdb_alt_break */ #define KDB_REQ_DEBUGGER 1 /* User requested Debugger */