adjust to new trace_{enter,exit} and dtrace

This commit is contained in:
christos 2015-03-07 18:50:01 +00:00
parent 73994f9f9a
commit cb193dfbea
4 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_syscall.c,v 1.39 2012/07/12 18:13:08 dsl Exp $ */
/* $NetBSD: freebsd_syscall.c,v 1.40 2015/03/07 18:50:01 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.39 2012/07/12 18:13:08 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.40 2015/03/07 18:50:01 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -112,8 +112,8 @@ freebsd_syscall(struct trapframe *frame)
goto bad;
}
if (!__predict_false(p->p_trace_enabled)
|| (error = trace_enter(code, args, callp->sy_narg)) == 0) {
if (!__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_entry))
|| (error = trace_enter(code, callp, args)) == 0) {
rval[0] = 0;
rval[1] = frame->tf_edx; /* need to keep edx for shared FreeBSD bins */
error = sy_call(callp, l, args, rval);
@ -143,8 +143,8 @@ freebsd_syscall(struct trapframe *frame)
break;
}
if (__predict_false(p->p_trace_enabled))
trace_exit(code, rval, error);
if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return)))
trace_exit(code, callp, args, rval, error);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_syscall.c,v 1.48 2012/07/12 18:13:08 dsl Exp $ */
/* $NetBSD: ibcs2_syscall.c,v 1.49 2015/03/07 18:50:01 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.48 2012/07/12 18:13:08 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.49 2015/03/07 18:50:01 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -111,8 +111,8 @@ ibcs2_syscall(struct trapframe *frame)
goto bad;
}
if (!__predict_false(p->p_trace_enabled)
|| (error = trace_enter(code, args, callp->sy_narg)) == 0) {
if (!__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_entry))
|| (error = trace_enter(code, callp, args)) == 0) {
rval[0] = 0;
rval[1] = 0;
error = sy_call(callp, l, args, rval);
@ -143,8 +143,8 @@ ibcs2_syscall(struct trapframe *frame)
break;
}
if (__predict_false(p->p_trace_enabled))
trace_exit(code, rval, error);
if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return)))
trace_exit(code, callp, args, rval, error);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.c,v 1.51 2011/09/28 17:27:21 christos Exp $ */
/* $NetBSD: linux_syscall.c,v 1.52 2015/03/07 18:50:01 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.51 2011/09/28 17:27:21 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.52 2015/03/07 18:50:01 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -99,12 +99,10 @@ linux_syscall(struct trapframe *frame)
rval[0] = 0;
rval[1] = 0;
if (__predict_false(l->l_proc->p_trace_enabled)) {
error = trace_enter(code, args, callp->sy_narg);
if (__predict_true(error == 0)) {
if (__predict_false(l->l_proc->p_trace_enabled || KDTRACE_ENTRY(callp->sy_entry))) {
error = trace_enter(code, callp, args);
if (__predict_true(error == 0))
error = sy_call(callp, l, args, rval);
trace_exit(code, rval, error);
}
} else
error = sy_call(callp, l, args, rval);
@ -137,6 +135,8 @@ linux_syscall(struct trapframe *frame)
break;
}
}
if (__predict_false(l->l_proc->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return)))
trace_exit(code, callp, args, rval, error);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_syscall.c,v 1.47 2012/07/12 18:13:08 dsl Exp $ */
/* $NetBSD: svr4_syscall.c,v 1.48 2015/03/07 18:50:01 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.47 2012/07/12 18:13:08 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.48 2015/03/07 18:50:01 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -108,8 +108,8 @@ svr4_syscall(struct trapframe *frame)
goto bad;
}
if (!__predict_false(p->p_trace_enabled)
|| (error = trace_enter(code, args, callp->sy_narg)) == 0) {
if (!__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_entry))
|| (error = trace_enter(code, callp, args)) == 0) {
rval[0] = 0;
rval[1] = 0;
error = sy_call(callp, l, args, rval);
@ -140,8 +140,8 @@ svr4_syscall(struct trapframe *frame)
break;
}
if (__predict_false(p->p_trace_enabled))
trace_exit(code, rval, error);
if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return)))
trace_exit(code, callp, args, rval, error);
userret(l);
}