diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2011-12-24 19:34:52 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2011-12-24 19:34:52 +0000 |
commit | 8eb9e6b5487506b4d0f3e50d440fac3e93baf702 (patch) | |
tree | cfe656c61e3dc2689d74c276ee2249f54a375705 /sys/powerpc/aim/trap.c | |
parent | 710f17be3ba715e7a297bf62e3944f4b95dd9fef (diff) | |
download | FreeBSD-src-8eb9e6b5487506b4d0f3e50d440fac3e93baf702.zip FreeBSD-src-8eb9e6b5487506b4d0f3e50d440fac3e93baf702.tar.gz |
Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.
Approved by: nwhitehorn (mentor)
MFC after: 9.0-RELEASE
Diffstat (limited to 'sys/powerpc/aim/trap.c')
-rw-r--r-- | sys/powerpc/aim/trap.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 93feb51..91f478c 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -34,6 +34,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_hwpmc_hooks.h" + #include <sys/param.h> #include <sys/kdb.h> #include <sys/proc.h> @@ -49,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include <sys/uio.h> #include <sys/signalvar.h> #include <sys/vmmeter.h> +#ifdef HWPMC_HOOKS +#include <sys/pmckern.h> +#endif #include <security/audit/audit.h> @@ -159,6 +164,16 @@ trap(struct trapframe *frame) CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name, trapname(type), user ? "user" : "kernel"); +#ifdef HWPMC_HOOKS + if (type == EXC_PERF && (pmc_intr != NULL)) { +#ifdef notyet + (*pmc_intr)(PCPU_GET(cpuid), frame); + if (!user) + return; +#endif + } + else +#endif if (user) { td->td_pticks = 0; td->td_frame = frame; |