git: 7f337c94b5dd - main - sdt: add __sdt_used

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Tue, 21 Feb 2023 13:50:34 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f337c94b5dd4b2848e5d5e32c2fc99b9d5ca515

commit 7f337c94b5dd4b2848e5d5e32c2fc99b9d5ca515
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-02-21 13:43:00 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-02-21 13:43:00 +0000

    sdt: add __sdt_used
    
    To pacify set-but-not-used warns when compiling without sdt probes.
    
    Reviewed by:
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:
---
 sys/sys/sdt.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index fb5c3d671604..2407ef88ab56 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -86,6 +86,8 @@ extern volatile bool sdt_probes_enabled;
 
 #ifndef KDTRACE_HOOKS
 
+#define __sdt_used	__unused
+
 #define SDT_PROVIDER_DEFINE(prov)
 #define SDT_PROVIDER_DECLARE(prov)
 #define SDT_PROBE_DEFINE(prov, mod, func, name)
@@ -141,6 +143,8 @@ extern volatile bool sdt_probes_enabled;
 
 #else
 
+#define __sdt_used
+
 SET_DECLARE(sdt_providers_set, struct sdt_provider);
 SET_DECLARE(sdt_probes_set, struct sdt_probe);
 SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);