diff options
author | mav <mav@FreeBSD.org> | 2013-02-26 18:13:42 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-02-26 18:13:42 +0000 |
commit | fdde785247aa4b313e6b871d4d4b56fdd9ac1af2 (patch) | |
tree | b98a6fb846e9e9cefda4e57b32706153c614b211 /sys/dev/hwpmc/hwpmc_soft.c | |
parent | 49f99b72515864c7f48e1d57295de7c122876049 (diff) | |
download | FreeBSD-src-fdde785247aa4b313e6b871d4d4b56fdd9ac1af2.zip FreeBSD-src-fdde785247aa4b313e6b871d4d4b56fdd9ac1af2.tar.gz |
Add support for good old 8192Hz profiling clock to software PMC.
Reviewed by: fabient
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_soft.c')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_soft.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index 0ed2262..48e297e 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #define SOFT_CAPS (PMC_CAP_READ | PMC_CAP_WRITE | PMC_CAP_INTERRUPT | \ PMC_CAP_USER | PMC_CAP_SYSTEM) +PMC_SOFT_DECLARE( , , clock, prof); + struct soft_descr { struct pmc_descr pm_descr; /* "base class" */ }; @@ -125,6 +127,8 @@ soft_allocate_pmc(int cpu, int ri, struct pmc *pm, return (EINVAL); pmc_soft_ev_release(ps); + if (ev == pmc___clock_prof.ps_ev.pm_ev_code) + cpu_startprofclock(); return (0); } @@ -324,9 +328,8 @@ soft_release_pmc(int cpu, int ri, struct pmc *pmc) KASSERT(phw->phw_pmc == NULL, ("[soft,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); - /* - * Nothing to do. - */ + if (pmc->pm_event == pmc___clock_prof.ps_ev.pm_ev_code) + cpu_stopprofclock(); return (0); } |