diff options
author | fabient <fabient@FreeBSD.org> | 2012-09-07 14:45:59 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2012-09-07 14:45:59 +0000 |
commit | 4bd6d33d2188a3f9623f72b531a2f53463a5abc3 (patch) | |
tree | dfec14a605c6119656be68827b71e7a453d2a305 /sys/dev | |
parent | 001c4aa6c4c64ee9584fbef16f7b2626cf58c41f (diff) | |
download | FreeBSD-src-4bd6d33d2188a3f9623f72b531a2f53463a5abc3.zip FreeBSD-src-4bd6d33d2188a3f9623f72b531a2f53463a5abc3.tar.gz |
Complete and merge the list between Sandy/Ivy bridge of events
that can run on specific PMC.
MFC after: 1 month
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_core.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index 35bdf64..11a275b 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -1695,36 +1695,29 @@ iap_event_westmere_ok_on_counter(enum pmc_event pe, int ri) } static int -iap_event_sandybridge_ok_on_counter(enum pmc_event pe, int ri) -{ - uint32_t mask; - - switch (pe) { - /* - * Events valid only on counter 2. - */ - case PMC_EV_IAP_EVENT_48H_01H: - mask = 0x4; - break; - default: - mask = ~0; /* Any row index is ok. */ - } - - return (mask & (1 << ri)); -} - -static int -iap_event_ivybridge_ok_on_counter(enum pmc_event pe, int ri) +iap_event_sb_ib_ok_on_counter(enum pmc_event pe, int ri) { uint32_t mask; switch (pe) { - /* - * Events valid only on counter 2. - */ + /* Events valid only on counter 0. */ + case PMC_EV_IAP_EVENT_B7H_01H: + mask = 0x1; + break; + /* Events valid only on counter 1. */ + case PMC_EV_IAP_EVENT_C0H_01H: + mask = 0x1; + break; + /* Events valid only on counter 2. */ case PMC_EV_IAP_EVENT_48H_01H: mask = 0x4; break; + /* Events valid only on counter 3. */ + case PMC_EV_IAP_EVENT_BBH_01H: + case PMC_EV_IAP_EVENT_CDH_01H: + case PMC_EV_IAP_EVENT_CDH_02H: + mask = 0x8; + break; default: mask = ~0; /* Any row index is ok. */ } @@ -1808,12 +1801,9 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm, if (iap_event_corei7_ok_on_counter(ev, ri) == 0) return (EINVAL); break; - case PMC_CPU_INTEL_IVYBRIDGE: - if (iap_event_ivybridge_ok_on_counter(ev, ri) == 0) - return (EINVAL); - break; case PMC_CPU_INTEL_SANDYBRIDGE: - if (iap_event_sandybridge_ok_on_counter(ev, ri) == 0) + case PMC_CPU_INTEL_IVYBRIDGE: + if (iap_event_sb_ib_ok_on_counter(ev, ri) == 0) return (EINVAL); break; case PMC_CPU_INTEL_WESTMERE: |