Date: Mon, 9 Jun 2008 06:56:24 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 143184 for review Message-ID: <200806090656.m596uOLw082609@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143184 Change 143184 by jb@freebsd3 on 2008/06/09 06:56:04 Add the cyclic timer hook for DTrace. Affected files ... .. //depot/projects/dtrace6/src/sys/amd64/amd64/local_apic.c#4 edit Differences ... ==== //depot/projects/dtrace6/src/sys/amd64/amd64/local_apic.c#4 (text+ko) ==== @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.17.2.15 2007/11/08 20:09:45 jhb Exp $"); #include "opt_hwpmc_hooks.h" +#include "opt_kdtrace.h" #include "opt_ddb.h" @@ -65,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 +668,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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806090656.m596uOLw082609>