PERFORCE change 143156 for review

John Birrell jb at FreeBSD.org
Mon Jun 9 03:08:29 UTC 2008


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

Change 143156 by jb at freebsd3 on 2008/06/09 03:08:03

	Add the cyclic hooks and modify the structure type to suit releng6.

Affected files ...

.. //depot/projects/dtrace6/src/sys/i386/i386/local_apic.c#3 edit
.. //depot/projects/dtrace6/src/sys/sys/dtrace_bsd.h#2 edit

Differences ...

==== //depot/projects/dtrace6/src/sys/i386/i386/local_apic.c#3 (text+ko) ====

@@ -35,6 +35,7 @@
 __FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.17.2.14 2007/10/05 15:22:36 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
+#include "opt_kdtrace.h"
 
 #include "opt_ddb.h"
 
@@ -51,6 +52,7 @@
 #include <vm/pmap.h>
 
 #include <machine/apicreg.h>
+#include <machine/cpu.h>
 #include <machine/cputypes.h>
 #include <machine/frame.h>
 #include <machine/intr_machdep.h>
@@ -64,6 +66,11 @@
 #include <ddb/ddb.h>
 #endif
 
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+cyclic_clock_func_t	lapic_cyclic_clock_func[MAXCPU];
+#endif
+
 /* Sanity checks on IDT vectors. */
 CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS == APIC_TIMER_INT);
 CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS);
@@ -662,6 +669,17 @@
 	(*la->la_timer_count)++;
 	critical_enter();
 
+#ifdef KDTRACE_HOOKS
+	/*
+	 * If the DTrace hooks are configured and a callback function
+	 * has been registered, then call it to process the high speed
+	 * timers.
+	 */
+	int cpu = PCPU_GET(cpuid);
+	if (lapic_cyclic_clock_func[cpu] != NULL)
+		(*lapic_cyclic_clock_func[cpu])(&frame);
+#endif
+
 	/* Fire hardclock at hz. */
 	la->la_hard_ticks += hz;
 	if (la->la_hard_ticks >= lapic_timer_hz) {

==== //depot/projects/dtrace6/src/sys/sys/dtrace_bsd.h#2 (text+ko) ====

@@ -32,6 +32,7 @@
 #define	_SYS_DTRACE_BSD_H
 
 /* Forward definitions: */
+struct clockframe;
 struct trapframe;
 struct thread;
 
@@ -39,7 +40,7 @@
  * Cyclic clock function type definition used to hook the cyclic
  * subsystem into the appropriate timer interrupt.
  */
-typedef	void (*cyclic_clock_func_t)(struct trapframe *);
+typedef	void (*cyclic_clock_func_t)(struct clockframe *);
 
 /*
  * These external variables are actually machine-dependent, so


More information about the p4-projects mailing list