Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jun 2008 07:11:31 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 144352 for review
Message-ID:  <200806300711.m5U7BVt2003206@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144352

Change 144352 by jb@freebsd3 on 2008/06/30 07:10:37

	Add hooks for the 32-bit syscalls.

Affected files ...

.. //depot/projects/dtrace/src/sys/amd64/ia32/ia32_syscall.c#8 edit

Differences ...

==== //depot/projects/dtrace/src/sys/amd64/ia32/ia32_syscall.c#8 (text+ko) ====

@@ -45,6 +45,7 @@
 #include "opt_clock.h"
 #include "opt_cpu.h"
 #include "opt_isa.h"
+#include "opt_kdtrace.h"
 #include "opt_ktrace.h"
 
 #include <sys/param.h>
@@ -81,6 +82,10 @@
 #include <machine/intr_machdep.h>
 #include <machine/md_var.h>
 
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+#endif
+
 #define	IDTVEC(name)	__CONCAT(X,name)
 
 extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd);
@@ -178,9 +183,34 @@
 
 		PTRACESTOP_SC(p, td, S_PT_SCE);
 
+#ifdef KDTRACE_HOOKS
+		/*
+		 * If the systrace module has registered it's probe
+		 * callback and if there is a probe active for the
+		 * syscall 'entry', process the probe.
+		 */
+		if (systrace_probe_func != NULL && callp->sy_entry != 0)
+			(*systrace_probe_func)(callp->sy_entry, code, callp,
+			    args64);
+#endif
+
 		AUDIT_SYSCALL_ENTER(code, td);
 		error = (*callp->sy_call)(td, args64);
 		AUDIT_SYSCALL_EXIT(error, td);
+
+		/* Save the latest error return value. */
+		td->td_errno = error;
+
+#ifdef KDTRACE_HOOKS
+		/*
+		 * If the systrace module has registered it's probe
+		 * callback and if there is a probe active for the
+		 * syscall 'return', process the probe.
+		 */
+		if (systrace_probe_func != NULL && callp->sy_return != 0)
+			(*systrace_probe_func)(callp->sy_return, code, callp,
+			    args64);
+#endif
 	}
 
 	switch (error) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806300711.m5U7BVt2003206>