git: a72edfea5719 - main - dtrace: avoid kinst warn when not used
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Nov 2022 13:45:53 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a72edfea571909070761d2d143df7d818b4f51b2 commit a72edfea571909070761d2d143df7d818b4f51b2 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2022-11-15 10:01:05 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2022-11-15 13:40:31 +0000 dtrace: avoid kinst warn when not used Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/cddl/dev/kinst/kinst.c | 9 +++++++-- 1 file 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;