diff options
author | br <br@FreeBSD.org> | 2015-01-28 16:08:07 +0000 |
---|---|---|
committer | br <br@FreeBSD.org> | 2015-01-28 16:08:07 +0000 |
commit | 236c1b153d8f9cb45e001cab10a5f7cde815ca08 (patch) | |
tree | fffab9a0d051c34807598c60199e574f6c344eec /sys/arm | |
parent | b7bb1dabe49776494d20ef55f89858d44829945d (diff) | |
download | FreeBSD-src-236c1b153d8f9cb45e001cab10a5f7cde815ca08.zip FreeBSD-src-236c1b153d8f9cb45e001cab10a5f7cde815ca08.tar.gz |
Add ARMv7 performance monitoring counters.
Differential Revision: https://reviews.freebsd.org/D1687
Reviewed by: rpaulo
Sponsored by: DARPA, AFRL
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/intr.c | 7 | ||||
-rw-r--r-- | sys/arm/include/pmc_mdep.h | 6 | ||||
-rw-r--r-- | sys/arm/ti/files.ti | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c index 030407a..e83bca9 100644 --- a/sys/arm/arm/intr.c +++ b/sys/arm/arm/intr.c @@ -37,6 +37,7 @@ */ #include "opt_platform.h" +#include "opt_hwpmc_hooks.h" #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -50,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/interrupt.h> #include <sys/conf.h> +#include <sys/pmc.h> +#include <sys/pmckern.h> #include <machine/atomic.h> #include <machine/intr.h> @@ -190,6 +193,10 @@ arm_irq_handler(struct trapframe *frame) arm_mask_irq(i); } } +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, frame); +#endif } /* diff --git a/sys/arm/include/pmc_mdep.h b/sys/arm/include/pmc_mdep.h index 6153df0..43546b8 100644 --- a/sys/arm/include/pmc_mdep.h +++ b/sys/arm/include/pmc_mdep.h @@ -30,12 +30,15 @@ #define _MACHINE_PMC_MDEP_H_ #define PMC_MDEP_CLASS_INDEX_XSCALE 1 +#define PMC_MDEP_CLASS_INDEX_ARMV7 1 /* * On the ARM platform we support the following PMCs. * * XSCALE Intel XScale processors + * ARMV7 ARM Cortex-A processors */ #include <dev/hwpmc/hwpmc_xscale.h> +#include <dev/hwpmc/hwpmc_armv7.h> union pmc_md_op_pmcallocate { uint64_t __pad[4]; @@ -48,6 +51,7 @@ union pmc_md_op_pmcallocate { #ifdef _KERNEL union pmc_md_pmc { struct pmc_md_xscale_pmc pm_xscale; + struct pmc_md_armv7_pmc pm_armv7; }; #define PMC_IN_KERNEL_STACK(S,START,END) \ @@ -73,6 +77,8 @@ union pmc_md_pmc { */ struct pmc_mdep *pmc_xscale_initialize(void); void pmc_xscale_finalize(struct pmc_mdep *_md); +struct pmc_mdep *pmc_armv7_initialize(void); +void pmc_armv7_finalize(struct pmc_mdep *_md); #endif /* _KERNEL */ #endif /* !_MACHINE_PMC_MDEP_H_ */ diff --git a/sys/arm/ti/files.ti b/sys/arm/ti/files.ti index 52ee22b..3cbab91 100644 --- a/sys/arm/ti/files.ti +++ b/sys/arm/ti/files.ti @@ -9,6 +9,7 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard +arm/arm/pmu.c optional hwpmc arm/ti/ti_common.c standard arm/ti/ti_cpuid.c standard |