Author: markj
Date: Sat Aug  9 14:05:01 2014
New Revision: 269752
URL: http://svnweb.freebsd.org/changeset/base/269752

Log:
  MFC r266826, r266827
  Move some duplicated hook definitions from machine-dependent files to
  kern_dtrace.c.

Modified:
  stable/10/sys/amd64/amd64/trap.c
  stable/10/sys/i386/i386/trap.c
  stable/10/sys/kern/kern_dtrace.c
  stable/10/sys/mips/mips/trap.c
  stable/10/sys/powerpc/aim/trap.c
  stable/10/sys/sys/dtrace_bsd.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/trap.c
==============================================================================
--- stable/10/sys/amd64/amd64/trap.c    Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/amd64/amd64/trap.c    Sat Aug  9 14:05:01 2014        
(r269752)
@@ -96,28 +96,6 @@ PMC_SOFT_DEFINE( , , page_fault, write);
 
 #ifdef KDTRACE_HOOKS
 #include <sys/dtrace_bsd.h>
-
-/*
- * This is a hook which is initialised by the dtrace module
- * to handle traps which might occur during DTrace probe
- * execution.
- */
-dtrace_trap_func_t     dtrace_trap_func;
-
-dtrace_doubletrap_func_t       dtrace_doubletrap_func;
-
-/*
- * This is a hook which is initialised by the systrace module
- * when it is loaded. This keeps the DTrace syscall provider
- * implementation opaque. 
- */
-systrace_probe_func_t  systrace_probe_func;
-
-/*
- * These hooks are necessary for the pid and usdt providers.
- */
-dtrace_pid_probe_ptr_t         dtrace_pid_probe_ptr;
-dtrace_return_probe_ptr_t      dtrace_return_probe_ptr;
 #endif
 
 extern void trap(struct trapframe *frame);

Modified: stable/10/sys/i386/i386/trap.c
==============================================================================
--- stable/10/sys/i386/i386/trap.c      Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/i386/i386/trap.c      Sat Aug  9 14:05:01 2014        
(r269752)
@@ -105,28 +105,6 @@ PMC_SOFT_DEFINE( , , page_fault, write);
 
 #ifdef KDTRACE_HOOKS
 #include <sys/dtrace_bsd.h>
-
-/*
- * This is a hook which is initialised by the dtrace module
- * to handle traps which might occur during DTrace probe
- * execution.
- */
-dtrace_trap_func_t     dtrace_trap_func;
-
-dtrace_doubletrap_func_t       dtrace_doubletrap_func;
-
-/*
- * This is a hook which is initialised by the systrace module
- * when it is loaded. This keeps the DTrace syscall provider
- * implementation opaque. 
- */
-systrace_probe_func_t  systrace_probe_func;
-
-/*
- * These hooks are necessary for the pid and usdt providers.
- */
-dtrace_pid_probe_ptr_t         dtrace_pid_probe_ptr;
-dtrace_return_probe_ptr_t      dtrace_return_probe_ptr;
 #endif
 
 extern void trap(struct trapframe *frame);

Modified: stable/10/sys/kern/kern_dtrace.c
==============================================================================
--- stable/10/sys/kern/kern_dtrace.c    Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/kern/kern_dtrace.c    Sat Aug  9 14:05:01 2014        
(r269752)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/proc.h>
 #include <sys/dtrace_bsd.h>
 #include <sys/sysctl.h>
+#include <sys/sysent.h>
 
 #define KDTRACE_PROC_SIZE      64
 #define        KDTRACE_THREAD_SIZE     256
@@ -47,6 +48,14 @@ FEATURE(kdtrace_hooks,
 
 static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks");
 
+/* Hooks used in the machine-dependent trap handlers. */
+dtrace_trap_func_t             dtrace_trap_func;
+dtrace_doubletrap_func_t       dtrace_doubletrap_func;
+dtrace_pid_probe_ptr_t         dtrace_pid_probe_ptr;
+dtrace_return_probe_ptr_t      dtrace_return_probe_ptr;
+
+systrace_probe_func_t          systrace_probe_func;
+
 /* Return the DTrace process data size compiled in the kernel hooks. */
 size_t
 kdtrace_proc_size()

Modified: stable/10/sys/mips/mips/trap.c
==============================================================================
--- stable/10/sys/mips/mips/trap.c      Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/mips/mips/trap.c      Sat Aug  9 14:05:01 2014        
(r269752)
@@ -94,28 +94,6 @@ __FBSDID("$FreeBSD$");
 
 #ifdef KDTRACE_HOOKS
 #include <sys/dtrace_bsd.h>
-
-/*
- * This is a hook which is initialised by the dtrace module
- * to handle traps which might occur during DTrace probe
- * execution.
- */
-dtrace_trap_func_t     dtrace_trap_func;
-
-dtrace_doubletrap_func_t       dtrace_doubletrap_func;
-
-/*
- * This is a hook which is initialised by the systrace module
- * when it is loaded. This keeps the DTrace syscall provider
- * implementation opaque. 
- */
-systrace_probe_func_t  systrace_probe_func;
-
-/*
- * These hooks are necessary for the pid and usdt providers.
- */
-dtrace_pid_probe_ptr_t         dtrace_pid_probe_ptr;
-dtrace_return_probe_ptr_t      dtrace_return_probe_ptr;
 #endif
 
 #ifdef TRAP_DEBUG

Modified: stable/10/sys/powerpc/aim/trap.c
==============================================================================
--- stable/10/sys/powerpc/aim/trap.c    Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/powerpc/aim/trap.c    Sat Aug  9 14:05:01 2014        
(r269752)
@@ -97,27 +97,6 @@ struct powerpc_exception {
 #ifdef KDTRACE_HOOKS
 #include <sys/dtrace_bsd.h>
 
-/*
- * This is a hook which is initialised by the dtrace module
- * to handle traps which might occur during DTrace probe
- * execution.
- */
-dtrace_trap_func_t     dtrace_trap_func;
-
-dtrace_doubletrap_func_t       dtrace_doubletrap_func;
-
-/*
- * This is a hook which is initialised by the systrace module
- * when it is loaded. This keeps the DTrace syscall provider
- * implementation opaque. 
- */
-systrace_probe_func_t  systrace_probe_func;
-
-/*
- * These hooks are necessary for the pid and usdt providers.
- */
-dtrace_pid_probe_ptr_t         dtrace_pid_probe_ptr;
-dtrace_return_probe_ptr_t      dtrace_return_probe_ptr;
 int (*dtrace_invop_jump_addr)(struct trapframe *);
 #endif
 

Modified: stable/10/sys/sys/dtrace_bsd.h
==============================================================================
--- stable/10/sys/sys/dtrace_bsd.h      Sat Aug  9 13:41:11 2014        
(r269751)
+++ stable/10/sys/sys/dtrace_bsd.h      Sat Aug  9 14:05:01 2014        
(r269752)
@@ -61,11 +61,13 @@ int dtrace_trap(struct trapframe *, u_in
 
 extern dtrace_trap_func_t      dtrace_trap_func;
 
-/* Used by the machine dependent trap() code. */
+/*
+ * A hook which removes active FBT probes before executing the double fault
+ * handler. We want to ensure that DTrace doesn't trigger another trap, which
+ * would result in a reset.
+ */
 typedef        int (*dtrace_invop_func_t)(uintptr_t, uintptr_t *, uintptr_t);
 typedef void (*dtrace_doubletrap_func_t)(void);
-
-/* Global variables in trap.c */
 extern dtrace_invop_func_t     dtrace_invop_func;
 extern dtrace_doubletrap_func_t        dtrace_doubletrap_func;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to