aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-02-28 17:04:36 +0000
committerMark Johnston <markj@FreeBSD.org>2020-02-28 17:04:36 +0000
commita7261520baf4a86851e37ca8076032e16276244e (patch)
treebc5f289db94925c63542dcfe162a26ed127778fd
parentc99d0c5801ce22a9976e491d04ce7e1b8996dfdd (diff)
downloadsrc-a7261520baf4a86851e37ca8076032e16276244e.tar.gz
src-a7261520baf4a86851e37ca8076032e16276244e.zip
Clear systrace_args_func when systrace probes are disabled.
This function pointer is invalidated when systrace.ko is unloaded. Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=358433
-rw-r--r--sys/cddl/dev/systrace/systrace.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c
index 2ef74cb15e0a..90274223c512 100644
--- a/sys/cddl/dev/systrace/systrace.c
+++ b/sys/cddl/dev/systrace/systrace.c
@@ -298,9 +298,9 @@ systrace_destroy(void *arg, dtrace_id_t id, void *parg)
* disabled.
*/
if (SYSTRACE_ISENTRY((uintptr_t)parg)) {
- ASSERT(sysent[sysnum].sy_entry == 0);
+ ASSERT(sysent[sysnum].sy_entry == DTRACE_IDNONE);
} else {
- ASSERT(sysent[sysnum].sy_return == 0);
+ ASSERT(sysent[sysnum].sy_return == DTRACE_IDNONE);
}
#endif
}
@@ -310,8 +310,7 @@ systrace_enable(void *arg, dtrace_id_t id, void *parg)
{
int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg);
- if (SYSENT[sysnum].sy_systrace_args_func == NULL)
- SYSENT[sysnum].sy_systrace_args_func = systrace_args;
+ SYSENT[sysnum].sy_systrace_args_func = systrace_args;
if (SYSTRACE_ISENTRY((uintptr_t)parg))
SYSENT[sysnum].sy_entry = id;
@@ -327,8 +326,9 @@ systrace_disable(void *arg, dtrace_id_t id, void *parg)
{
int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg);
- SYSENT[sysnum].sy_entry = 0;
- SYSENT[sysnum].sy_return = 0;
+ SYSENT[sysnum].sy_systrace_args_func = NULL;
+ SYSENT[sysnum].sy_entry = DTRACE_IDNONE;
+ SYSENT[sysnum].sy_return = DTRACE_IDNONE;
systrace_enabled_count--;
if (systrace_enabled_count == 0)
systrace_enabled = false;