Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 add dtrace hooks
details: https://anonhg.NetBSD.org/src/rev/b266aa843fcb
branches: trunk
changeset: 336606:b266aa843fcb
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 07 18:41:40 2015 +0000
description:
add dtrace hooks
diffstat:
sys/arch/amd64/amd64/linux32_syscall.c | 16 ++++++++++------
sys/arch/amd64/amd64/linux_syscall.c | 12 ++++++------
sys/arch/amd64/amd64/netbsd32_syscall.c | 19 +++++++++++++------
3 files changed, 29 insertions(+), 18 deletions(-)
diffs (137 lines):
diff -r ca1f10a71ce6 -r b266aa843fcb sys/arch/amd64/amd64/linux32_syscall.c
--- a/sys/arch/amd64/amd64/linux32_syscall.c Sat Mar 07 17:47:09 2015 +0000
+++ b/sys/arch/amd64/amd64/linux32_syscall.c Sat Mar 07 18:41:40 2015 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: linux32_syscall.c,v 1.31 2014/11/25 19:54:08 christos Exp $ */
+/* $NetBSD: linux32_syscall.c,v 1.32 2015/03/07 18:41:40 christos Exp $ */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.31 2014/11/25 19:54:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.32 2015/03/07 18:41:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,14 +63,14 @@
args[4] = frame->tf_rdi & 0xffffffff;
args[5] = frame->tf_rbp & 0xffffffff;
- if (__predict_false(p->p_trace_enabled)) {
+ if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return))) {
narg = callp->sy_narg;
if (__predict_false(narg > __arraycount(args)))
panic("impossible syscall narg, code %d, narg %zu",
code, narg);
for (i = 0; i < narg; i++)
args64[i] = args[i] & 0xffffffff;
- if ((error = trace_enter(code, args64, narg)) != 0)
+ if ((error = trace_enter(code, callp, args64)) != 0)
goto out;
}
@@ -102,7 +102,11 @@
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))) {
+ narg = callp->sy_narg;
+ for (i = 0; i < narg; i++)
+ args64[i] = args[i] & 0xffffffff;
+ trace_exit(code, callp, args64, rval, error);
+ }
userret(l);
}
diff -r ca1f10a71ce6 -r b266aa843fcb sys/arch/amd64/amd64/linux_syscall.c
--- a/sys/arch/amd64/amd64/linux_syscall.c Sat Mar 07 17:47:09 2015 +0000
+++ b/sys/arch/amd64/amd64/linux_syscall.c Sat Mar 07 18:41:40 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.c,v 1.31 2010/12/20 00:25:24 matt Exp $ */
+/* $NetBSD: linux_syscall.c,v 1.32 2015/03/07 18:41:40 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.31 2010/12/20 00:25:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.32 2015/03/07 18:41:40 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_linux.h"
@@ -97,8 +97,8 @@
* already adjacent in the syscall trapframe.
*/
- 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)
goto out;
rval[0] = 0;
@@ -126,8 +126,8 @@
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);
}
diff -r ca1f10a71ce6 -r b266aa843fcb sys/arch/amd64/amd64/netbsd32_syscall.c
--- a/sys/arch/amd64/amd64/netbsd32_syscall.c Sat Mar 07 17:47:09 2015 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_syscall.c Sat Mar 07 18:41:40 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscall.c,v 1.32 2014/05/16 12:55:43 njoly Exp $ */
+/* $NetBSD: netbsd32_syscall.c,v 1.33 2015/03/07 18:41:40 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -29,8 +29,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#if defined(_KERNEL) && defined(_KERNEL_OPT)
+#include "opt_dtrace.h"
+#endif
+
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.32 2014/05/16 12:55:43 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.33 2015/03/07 18:41:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -88,12 +92,12 @@
goto bad;
}
- if (__predict_false(p->p_trace_enabled)
+ if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_entry))
&& !__predict_false(callp->sy_flags & SYCALL_INDIRECT)) {
int narg = callp->sy_argsize >> 2;
for (i = 0; i < narg; i++)
args64[i] = args[i];
- error = trace_enter(code, args64, narg);
+ error = trace_enter(code, callp, args64);
if (__predict_false(error != 0))
goto out;
}
@@ -103,9 +107,12 @@
error = sy_call(callp, l, args, rval);
out:
- if (__predict_false(p->p_trace_enabled)
+ if (__predict_false(p->p_trace_enabled || KDTRACE_ENTRY(callp->sy_return))
&& !__predict_false(callp->sy_flags & SYCALL_INDIRECT)) {
- trace_exit(code, rval, error);
+ int narg = callp->sy_argsize >> 2;
+ for (i = 0; i < narg; i++)
+ args64[i] = args[i];
+ trace_exit(code, callp, args64, rval, error);
}
if (__predict_true(error == 0)) {
Home |
Main Index |
Thread Index |
Old Index