From nobody Thu Apr 18 18:19:04 2024 X-Original-To: dev-commits-src-all@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 4VL5dN3mMvz5HKwH; Thu, 18 Apr 2024 18:19:04 +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 4VL5dN2drTz427t; Thu, 18 Apr 2024 18:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713464344; 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=rYuBPVxMcONnBbBuOdrN6fh9RYMehXTLS9wznk5Hygk=; b=lFj+iJ1gtaEnxb6bKpJuEiqScy4gESXgxVJdue8x5EcpVz1qY4hAKzTanzQS/4KU3R5TtJ X/QQAUwU7qixBQbgkwAbQdbSVPWHJndhcg0LFCPG8cawnlwOuUVrVVuaPfHJ+bBQZ7NsKI uGa6EcBnZ1RtuKRJ27T2SeBQ9Rh45WvUTCRx0UzPODAwDvo/cBidikaeaAP1xme1zqvqo8 vBr7xELMRBhLQVbXkvpRvT6sVsNuji8pnkL/3vt8wbVgsMcK1wFYFp9zvGodbMCk7tFbMO ZMKZfF/Ba6K+nbClw4CCcpLrIZjf9iM2cv0We3m235XpHl5amhmaIdBPXwfaqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713464344; a=rsa-sha256; cv=none; b=pEVe3uP3cpKxqlYubn/M0vMxyr5zl8R10gIJ5hbXdmbhPN+16hDszdr/keuAqTdPS1qtHv TIa4Y+GePDapwHBOuxU0q9uHTw8F4ZzUzv9tL1tVYYypMTpvsSwvaxuidEBu1xMqegal4w 3Dpe2znDgfQ4z+jQMilslYfitU+OJd36GR3gwdwe93nauRPN3j8h9XMw7Ek2CIrXRlg7DR J02HEK4xtdwwmjkx+DSO7n6Fy7hsiySybzcQdJJD2iupSUFbMeEBLjOY4AFmf4SJIUVivU 8b37Y1Kmh+rXksrnwmMbtawk0HWfo0qcpf/Hg8oL79Z4dJvh4h+q1rkYgIHLlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713464344; 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=rYuBPVxMcONnBbBuOdrN6fh9RYMehXTLS9wznk5Hygk=; b=cQ5+gQ9BnQuNPSdrvL9h7yXVGYB+B4gNdRVsqyqmJ6Ctq6fp5v0r+FeZEt79A0Lh4UWu8I WiBTmhaxaCGbTb4vodvxor9ziK+BYMZqre5EvbdCJ0obCjPd+ouqmMs0MUFibl0d8PqSXm rBjph9FBkGiV++gAox0T0skSWw+BNA8vuVKW234tehx2nFLdZbPa9mI+MJtzweZbOuxrqa +i5mxhsI/kSQkT0ZpDz7TVFWvDq2bO/yrKuAO5f5w7WJg/R/ytOvLhBXYlCcaUH5WX6T23 e1A1hgUhsxlaPVcRWuHOBJJypkiGRyJwN9FEJIS7PTqPRO4EfUAKUuwVpFkkxg== 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 4VL5dN2GGyzJxg; Thu, 18 Apr 2024 18:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43IIJ4iJ017602; Thu, 18 Apr 2024 18:19:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43IIJ4Ms017599; Thu, 18 Apr 2024 18:19:04 GMT (envelope-from git) Date: Thu, 18 Apr 2024 18:19:04 GMT Message-Id: <202404181819.43IIJ4Ms017599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 0c62a06b84ab - stable/14 - kassert.h: update MPASS definition commentary List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c62a06b84abde27e170d783b1c8cce3402831ca Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0c62a06b84abde27e170d783b1c8cce3402831ca commit 0c62a06b84abde27e170d783b1c8cce3402831ca Author: Mitchell Horne AuthorDate: 2024-03-21 15:21:41 +0000 Commit: Mitchell Horne CommitDate: 2024-04-18 18:17:52 +0000 kassert.h: update MPASS definition commentary We now have a detailed man page describing both MPASS and KASSERT. Give a warning that careless use of MPASS can result in inadequate assertion messages, and point to the MPASS(9) page which describes this. While here add a comment above the KASSERT definitions pointing to the man page. Suggested by: bz Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44438 (cherry picked from commit 36de8bb226671ef9fe373d8d95f77cdb76157738) --- sys/sys/kassert.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index da7b66854a14..8e22e0e2c9f9 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -112,6 +112,9 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); # endif /* defined(WITNESS) || defined(INVARIANT_SUPPORT) */ #endif /* _STANDALONE */ +/* + * Kernel assertion; see KASSERT(9) for details. + */ #if (defined(_KERNEL) && defined(INVARIANTS)) || defined(_STANDALONE) #define KASSERT(exp,msg) do { \ if (__predict_false(!(exp))) \ @@ -124,8 +127,11 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); #ifdef _KERNEL /* - * Helpful macros for quickly coming up with assertions with informative - * panic messages. + * Macros for generating panic messages based on the exact condition text. + * + * NOTE: Use these with care, as the resulting message might omit key + * information required to understand the assertion failure. Consult the + * MPASS(9) man page for guidance. */ #define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) #define MPASS2(ex, what) MPASS4(ex, what, __FILE__, __LINE__)