summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2005-05-30 06:29:29 +0000
committerjkoshy <jkoshy@FreeBSD.org>2005-05-30 06:29:29 +0000
commitad86ac4ba488543f1b0c0667a071e2bb197b7f9a (patch)
tree7e883bbffeb74552930e9883202ed3d7c3123a4a /sys/kern/kern_clock.c
parentf570134192d2d751237ed54f0fb9baa2fea5aeb5 (diff)
downloadFreeBSD-src-ad86ac4ba488543f1b0c0667a071e2bb197b7f9a.zip
FreeBSD-src-ad86ac4ba488543f1b0c0667a071e2bb197b7f9a.tar.gz
Kernel hooks to support PMC sampling modes.
Reviewed by: alc
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 4ac211d..070d459 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -69,6 +69,10 @@ __FBSDID("$FreeBSD$");
#include <sys/gmon.h>
#endif
+#ifdef HWPMC_HOOKS
+#include <sys/pmckern.h>
+#endif
+
#ifdef DEVICE_POLLING
extern void hardclock_device_poll(void);
#endif /* DEVICE_POLLING */
@@ -191,6 +195,11 @@ hardclock_process(frame)
}
}
mtx_unlock_spin_flags(&sched_lock, MTX_QUIET);
+
+#ifdef HWPMC_HOOKS
+ if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
+ PMC_CALL_HOOK_UNLOCKED(curthread, PMC_FN_DO_SAMPLES, NULL);
+#endif
}
/*
OpenPOWER on IntegriCloud