diff options
author | Mark Johnston <markj@FreeBSD.org> | 2020-02-28 17:05:04 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2020-02-28 17:05:04 +0000 |
commit | 46994ec2b14d3fedbf712dd2cfb405c47632d920 (patch) | |
tree | 277a27d2963f2681758bf527d1dedd8e68b8fcea | |
parent | a7261520baf4a86851e37ca8076032e16276244e (diff) | |
download | src-46994ec2b14d3fedbf712dd2cfb405c47632d920.tar.gz src-46994ec2b14d3fedbf712dd2cfb405c47632d920.zip |
Fix standalone builds of systrace.ko after r357912.
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=358434
-rw-r--r-- | sys/kern/subr_syscall.c | 3 | ||||
-rw-r--r-- | sys/sys/sysent.h | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index e160e357924f..a67a0a28ba39 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -141,7 +141,8 @@ syscallenter(struct thread *td) /* Let system calls set td_errno directly. */ td->td_pflags &= ~TDP_NERRNO; - if (__predict_false(systrace_enabled || AUDIT_SYSCALL_ENTER(sa->code, td))) { + if (__predict_false(SYSTRACE_ENABLED() || + AUDIT_SYSCALL_ENTER(sa->code, td))) { #ifdef KDTRACE_HOOKS /* Give the syscall:::entry DTrace probe a chance to fire. */ if (__predict_false(sa->callp->sy_entry != 0)) diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 76e69b52f98e..4986dd8c01c0 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -42,6 +42,7 @@ struct thread; struct ksiginfo; struct syscall_args; +#ifdef _KERNEL enum systrace_probe_t { SYSTRACE_ENTRY, SYSTRACE_RETURN, @@ -53,14 +54,15 @@ typedef void (*systrace_probe_func_t)(struct syscall_args *, enum systrace_probe_t, int); typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); -#ifdef _KERNEL -#ifdef KDTRACE_HOOKS +extern systrace_probe_func_t systrace_probe_func; extern bool systrace_enabled; + +#ifdef KDTRACE_HOOKS +#define SYSTRACE_ENABLED() (systrace_enabled) #else -#define systrace_enabled 0 -#endif +#define SYSTRACE_ENABLED() (0) #endif -extern systrace_probe_func_t systrace_probe_func; +#endif /* _KERNEL */ struct sysent { /* system call table */ int sy_narg; /* number of arguments */ |