aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2022-11-15 10:01:05 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2022-11-15 13:40:31 +0000
commita72edfea571909070761d2d143df7d818b4f51b2 (patch)
treecdd3969e99bf11ecb7fa46ad9e7bbc61d9e08628
parent5d310ea8c5f98bbf53078ec632f6441f54dc9e44 (diff)
dtrace: avoid kinst warn when not used
Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--sys/cddl/dev/kinst/kinst.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c
index a7d04e927fa7..0b8d4dd4e657 100644
--- a/sys/cddl/dev/kinst/kinst.c
+++ b/sys/cddl/dev/kinst/kinst.c
@@ -153,6 +153,13 @@ static void
kinst_enable(void *arg, dtrace_id_t id, void *parg)
{
struct kinst_probe *kp = parg;
+ static bool warned = false;
+
+ if (!warned) {
+ KINST_LOG(
+ "kinst: This provider is experimental, exercise caution");
+ warned = true;
+ }
kinst_patch_tracepoint(kp, kp->kp_patchval);
}
@@ -208,8 +215,6 @@ kinst_modevent(module_t mod __unused, int type, void *data __unused)
switch (type) {
case MOD_LOAD:
- KINST_LOG(
- "kinst: This provider is experimental, exercise caution");
break;
case MOD_UNLOAD:
break;