summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc/hwpmc_intel.c
diff options
context:
space:
mode:
authorfabient <fabient@FreeBSD.org>2010-04-02 13:23:49 +0000
committerfabient <fabient@FreeBSD.org>2010-04-02 13:23:49 +0000
commit85d5b2855f1b8db1aa9a2dd7945b711399a111b7 (patch)
tree74703b81e372faa288cd54560b3715fd2bc1e0ce /sys/dev/hwpmc/hwpmc_intel.c
parent0e3cec01fc03abe666c04e3bfb10c74c603bc896 (diff)
downloadFreeBSD-src-85d5b2855f1b8db1aa9a2dd7945b711399a111b7.zip
FreeBSD-src-85d5b2855f1b8db1aa9a2dd7945b711399a111b7.tar.gz
- Support for uncore counting events: one fixed PMC with the uncore
domain clock, 8 programmable PMC. - Westmere based CPU (Xeon 5600, Corei7 980X) support. - New man pages with events list for core and uncore. - Updated Corei7 events with Intel 253669-033US December 2009 doc. There is some removed events in the documentation, they have been kept in the code but documented in the man page as obsolete. - Offcore response events can be setup with rsp token. Sponsored by: NETASQ
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_intel.c')
-rw-r--r--sys/dev/hwpmc/hwpmc_intel.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c
index e953f68..82d5079 100644
--- a/sys/dev/hwpmc/hwpmc_intel.c
+++ b/sys/dev/hwpmc/hwpmc_intel.c
@@ -133,8 +133,14 @@ pmc_intel_initialize(void)
case 0x1A:
case 0x1E: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */
case 0x1F: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */
+ case 0x2E:
cputype = PMC_CPU_INTEL_COREI7;
- nclasses = 3;
+ nclasses = 5;
+ break;
+ case 0x25: /* Per Intel document 253669-033US 12/2009. */
+ case 0x2C: /* Per Intel document 253669-033US 12/2009. */
+ cputype = PMC_CPU_INTEL_WESTMERE;
+ nclasses = 5;
break;
}
break;
@@ -176,6 +182,7 @@ pmc_intel_initialize(void)
case PMC_CPU_INTEL_CORE2:
case PMC_CPU_INTEL_CORE2EXTREME:
case PMC_CPU_INTEL_COREI7:
+ case PMC_CPU_INTEL_WESTMERE:
error = pmc_core_initialize(pmc_mdep, ncpus);
break;
@@ -226,6 +233,22 @@ pmc_intel_initialize(void)
KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__));
}
+ /*
+ * Init the uncore class.
+ */
+#if defined(__i386__) || defined(__amd64__)
+ switch (cputype) {
+ /*
+ * Intel Corei7 and Westmere processors.
+ */
+ case PMC_CPU_INTEL_COREI7:
+ case PMC_CPU_INTEL_WESTMERE:
+ error = pmc_uncore_initialize(pmc_mdep, ncpus);
+ break;
+ default:
+ break;
+ }
+#endif
error:
if (error) {
@@ -247,6 +270,8 @@ pmc_intel_finalize(struct pmc_mdep *md)
case PMC_CPU_INTEL_CORE:
case PMC_CPU_INTEL_CORE2:
case PMC_CPU_INTEL_CORE2EXTREME:
+ case PMC_CPU_INTEL_COREI7:
+ case PMC_CPU_INTEL_WESTMERE:
pmc_core_finalize(md);
break;
@@ -269,4 +294,18 @@ pmc_intel_finalize(struct pmc_mdep *md)
default:
KASSERT(0, ("[intel,%d] unknown CPU type", __LINE__));
}
+
+ /*
+ * Uncore.
+ */
+#if defined(__i386__) || defined(__amd64__)
+ switch (md->pmd_cputype) {
+ case PMC_CPU_INTEL_COREI7:
+ case PMC_CPU_INTEL_WESTMERE:
+ pmc_uncore_finalize(md);
+ break;
+ default:
+ break;
+ }
+#endif
}
OpenPOWER on IntegriCloud