diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2022-11-15 10:01:05 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2022-11-15 13:40:31 +0000 |
commit | a72edfea571909070761d2d143df7d818b4f51b2 (patch) | |
tree | cdd3969e99bf11ecb7fa46ad9e7bbc61d9e08628 | |
parent | 5d310ea8c5f98bbf53078ec632f6441f54dc9e44 (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.c | 9 |
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; |