Fix standalone builds of systrace.ko after r357912.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2020-02-28 17:05:04 +00:00
parent a7261520ba
commit 46994ec2b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358434
2 changed files with 11 additions and 8 deletions

View File

@ -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))

View File

@ -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 bool systrace_enabled;
#else
#define systrace_enabled 0
#endif
#endif
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
#endif /* _KERNEL */
struct sysent { /* system call table */
int sy_narg; /* number of arguments */