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 | |
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')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 1 | ||||
-rw-r--r-- | sys/powerpc/aim/trap.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 2049949..a3c36c5 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -499,6 +499,7 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, bcopy(generictrap, (void *)EXC_SC, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_FPA, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_PERF, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VECAST_G4, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VECAST_G5, (size_t)&trapsize); #ifndef __powerpc64__ 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; |