From nobody Fri Jun 16 16:45:08 2023 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 4QjQ4h5FsBz4dv0b; Fri, 16 Jun 2023 16:45:08 +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 4QjQ4h4Vc6z3HxZ; Fri, 16 Jun 2023 16:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686933908; 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=0ZAkc1ThKiKygyUfQflHvYi0qBvkGMinI38RteeAxGU=; b=PRSIHKGTcyHAP8fZQp4lvpPmgBWKqvaTtHx6b+yp09IgurJd1G9lYR4CdcP21WXJOiRdLr cFy7USe5H+MKQ/y24WvupSKANSFgm2B3JtxNgKDnEmKSinu6pDYhff06P4YHOUrk6AdeEv gVK3KZqr3Qj6U8O8CK95LIx/bkRCtrzfYngLM6R0gJ4hlHkS3hXZ2wAF3YoMc52BnwF4qJ b9wda1CwkISEaWYL7SWED6mhPul/FqyQ3XF/gv54GTsvOtBf4Bt62M6nf7uCSuEaovJ6aj GRqB/SKsVtjFMbIvSWKnDlcHVDv9M5rcHYAEjFRjnsEKnPHc8nRD+6HfrYAJgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686933908; 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=0ZAkc1ThKiKygyUfQflHvYi0qBvkGMinI38RteeAxGU=; b=H7opjMFUVdvPWIKo+Eyd1ikgpi6kK8n0cjyKmHQ1FlDsEqla2YtNVBD82n0TYBOyinC7fc TJtrVUsOp9omYObeQskL71Oy8tCFKF6i3JoqYGfJc60N+Iw1OY4lQt1wb7MnDtoVowi3B6 e07HqD8DeTUt2bowMc5DdK9SSL7GIjgSZGH8LOKvidiu+KLLdGwdov14uI2QyrzX+fnlRB jJ3czXtqfrGERleqJxXRkCO9noW6It2Il6szMLg6N3CRRjSaGZ7sY8y6m/aU07jC1SmwXp D26ajlxqzA+yljv7eLd6b/md+U121IAaTa8lfNuwT1LuORueH5yizkFOPCHF/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686933908; a=rsa-sha256; cv=none; b=iypR4jnDWJiZIMnXURC9a4ndpVWDfoev5bBdvkFma2vCgOyLh/oMD2Lx3O5ydQ3p37w/D+ SVks3FXW8Pn5VMimZ/zYjrUKuCbHPGpEdnWbWtT/Esr2ej7c1+dvv1MQUVxkmWLZhZrKik 7RcCwMrRdq/pTbJcBtosthaBlMAM0YIKyqEPnfhokJ+Qa+bV6fQu1Drrav53eWcWtuwbQR 3Jy98Qs6o4ZGGeG6yD1dTYCPqWNTLP5i4FcRsoUjHORI56FPLIA5IKpT6ti9y3wdFnoRZY fbndu0R82zxoI1OU57GWh7tlv6oy28/BeLEE9H8EiLyv/OfI5ly+KJD9s2nxow== 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 4QjQ4h3ZFhzbRy; Fri, 16 Jun 2023 16:45:08 +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 35GGj8n0072890; Fri, 16 Jun 2023 16:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35GGj8kK072889; Fri, 16 Jun 2023 16:45:08 GMT (envelope-from git) Date: Fri, 16 Jun 2023 16:45:08 GMT Message-Id: <202306161645.35GGj8kK072889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 569f89b2f442 - main - hwpmc: add error for HWPMC_DEBUG without KTR 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 569f89b2f442e2187f750a5892a1662390364cc6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=569f89b2f442e2187f750a5892a1662390364cc6 commit 569f89b2f442e2187f750a5892a1662390364cc6 Author: Mitchell Horne AuthorDate: 2023-06-16 16:38:26 +0000 Commit: Mitchell Horne CommitDate: 2023-06-16 16:44:54 +0000 hwpmc: add error for HWPMC_DEBUG without KTR The option is a no-op otherwise, but this is not necessarily obvious. Failing the compile gives the user a hint. Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40544 --- sys/sys/pmc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index cc8c4108aecc..cbb82408dcbf 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1069,6 +1069,12 @@ extern struct pmc_cpu **pmc_pcpu; extern struct pmc_driverstats pmc_stats; #if defined(HWPMC_DEBUG) + +/* HWPMC_DEBUG without KTR will compile but is a no-op. */ +#if !defined(KTR) || !defined(KTR_COMPILE) || ((KTR_COMPILE & KTR_SUBSYS) == 0) +#error "HWPMC_DEBUG requires KTR and KTR_COMPILE=KTR_SUBSYS -- see ktr(4)" +#endif + #include #define __pmcdbg_used /* unused variable annotation */