PERFORCE change 144352 for review

John Birrell jb at FreeBSD.org
Mon Jun 30 07:11:32 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=144352

Change 144352 by jb at 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) {


More information about the p4-projects mailing list