libpmc.c (233628) | libpmc.c (240164) |
---|---|
1/*- 2 * Copyright (c) 2003-2008 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003-2008 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/lib/libpmc/libpmc.c 233628 2012-03-28 20:58:30Z fabient $"); | 28__FBSDID("$FreeBSD: head/lib/libpmc/libpmc.c 240164 2012-09-06 13:54:01Z fabient $"); |
29 30#include <sys/types.h> 31#include <sys/module.h> 32#include <sys/pmc.h> 33#include <sys/syscall.h> 34 35#include <ctype.h> 36#include <errno.h> --- 141 unchanged lines hidden (view full) --- 178 __PMC_EV_ALIAS_CORE2() 179}; 180 181static const struct pmc_event_descr corei7_event_table[] = 182{ 183 __PMC_EV_ALIAS_COREI7() 184}; 185 | 29 30#include <sys/types.h> 31#include <sys/module.h> 32#include <sys/pmc.h> 33#include <sys/syscall.h> 34 35#include <ctype.h> 36#include <errno.h> --- 141 unchanged lines hidden (view full) --- 178 __PMC_EV_ALIAS_CORE2() 179}; 180 181static const struct pmc_event_descr corei7_event_table[] = 182{ 183 __PMC_EV_ALIAS_COREI7() 184}; 185 |
186static const struct pmc_event_descr ivybridge_event_table[] = 187{ 188 __PMC_EV_ALIAS_IVYBRIDGE() 189}; 190 |
|
186static const struct pmc_event_descr sandybridge_event_table[] = 187{ 188 __PMC_EV_ALIAS_SANDYBRIDGE() 189}; 190 191static const struct pmc_event_descr westmere_event_table[] = 192{ 193 __PMC_EV_ALIAS_WESTMERE() --- 23 unchanged lines hidden (view full) --- 217 static const enum pmc_class N##_pmc_classes[] = { \ 218 PMC_CLASS_##C, __VA_ARGS__ \ 219 } 220 221PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); 222PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); 223PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); 224PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); | 191static const struct pmc_event_descr sandybridge_event_table[] = 192{ 193 __PMC_EV_ALIAS_SANDYBRIDGE() 194}; 195 196static const struct pmc_event_descr westmere_event_table[] = 197{ 198 __PMC_EV_ALIAS_WESTMERE() --- 23 unchanged lines hidden (view full) --- 222 static const enum pmc_class N##_pmc_classes[] = { \ 223 PMC_CLASS_##C, __VA_ARGS__ \ 224 } 225 226PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); 227PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); 228PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); 229PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); |
230PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); |
|
225PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); 226PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); 227PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); 228PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); 229PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC); 230PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC); 231PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC); 232PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); --- 21 unchanged lines hidden (view full) --- 254 } 255 256#if defined(__i386__) || defined(__amd64__) 257PMC_CLASS_TABLE_DESC(iaf, IAF, iaf, iaf); 258PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap); 259PMC_CLASS_TABLE_DESC(core, IAP, core, iap); 260PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); 261PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); | 231PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); 232PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); 233PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); 234PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); 235PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC); 236PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC); 237PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC); 238PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); --- 21 unchanged lines hidden (view full) --- 260 } 261 262#if defined(__i386__) || defined(__amd64__) 263PMC_CLASS_TABLE_DESC(iaf, IAF, iaf, iaf); 264PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap); 265PMC_CLASS_TABLE_DESC(core, IAP, core, iap); 266PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); 267PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); |
268PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); |
|
262PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); 263PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); 264PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); 265PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); 266PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp); 267PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp); 268#endif 269#if defined(__i386__) --- 90 unchanged lines hidden (view full) --- 360 */ 361static int pmc_syscall = -1; 362static struct pmc_cpuinfo cpu_info; 363static struct pmc_op_getdyneventinfo soft_event_info; 364 365/* Event masks for events */ 366struct pmc_masks { 367 const char *pm_name; | 269PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); 270PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); 271PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); 272PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); 273PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp); 274PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp); 275#endif 276#if defined(__i386__) --- 90 unchanged lines hidden (view full) --- 367 */ 368static int pmc_syscall = -1; 369static struct pmc_cpuinfo cpu_info; 370static struct pmc_op_getdyneventinfo soft_event_info; 371 372/* Event masks for events */ 373struct pmc_masks { 374 const char *pm_name; |
368 const uint32_t pm_value; | 375 const uint64_t pm_value; |
369}; 370#define PMCMASK(N,V) { .pm_name = #N, .pm_value = (V) } 371#define NULLMASK { .pm_name = NULL } 372 373#if defined(__amd64__) || defined(__i386__) 374static int | 376}; 377#define PMCMASK(N,V) { .pm_name = #N, .pm_value = (V) } 378#define NULLMASK { .pm_name = NULL } 379 380#if defined(__amd64__) || defined(__i386__) 381static int |
375pmc_parse_mask(const struct pmc_masks *pmask, char *p, uint32_t *evmask) | 382pmc_parse_mask(const struct pmc_masks *pmask, char *p, uint64_t *evmask) |
376{ 377 const struct pmc_masks *pm; 378 char *q, *r; 379 int c; 380 381 if (pmask == NULL) /* no mask keywords */ 382 return (-1); 383 q = strchr(p, '='); /* skip '=' */ --- 172 unchanged lines hidden (view full) --- 556 EV_ALIAS("unhalted-cycles", "iap-cpu-clk-unhalted.core_p"), 557 EV_ALIAS(NULL, NULL) 558}; 559 560#define atom_aliases core2_aliases 561#define atom_aliases_without_iaf core2_aliases_without_iaf 562#define corei7_aliases core2_aliases 563#define corei7_aliases_without_iaf core2_aliases_without_iaf | 383{ 384 const struct pmc_masks *pm; 385 char *q, *r; 386 int c; 387 388 if (pmask == NULL) /* no mask keywords */ 389 return (-1); 390 q = strchr(p, '='); /* skip '=' */ --- 172 unchanged lines hidden (view full) --- 563 EV_ALIAS("unhalted-cycles", "iap-cpu-clk-unhalted.core_p"), 564 EV_ALIAS(NULL, NULL) 565}; 566 567#define atom_aliases core2_aliases 568#define atom_aliases_without_iaf core2_aliases_without_iaf 569#define corei7_aliases core2_aliases 570#define corei7_aliases_without_iaf core2_aliases_without_iaf |
571#define ivybridge_aliases core2_aliases 572#define ivybridge_aliases_without_iaf core2_aliases_without_iaf |
|
564#define sandybridge_aliases core2_aliases 565#define sandybridge_aliases_without_iaf core2_aliases_without_iaf 566#define westmere_aliases core2_aliases 567#define westmere_aliases_without_iaf core2_aliases_without_iaf 568 569#define IAF_KW_OS "os" 570#define IAF_KW_USR "usr" 571#define IAF_KW_ANYTHREAD "anythread" --- 86 unchanged lines hidden (view full) --- 658}; 659 660static struct pmc_masks iap_transition_mask[] = { 661 PMCMASK(any, 0x00), 662 PMCMASK(frequency, 0x10), 663 NULLMASK 664}; 665 | 573#define sandybridge_aliases core2_aliases 574#define sandybridge_aliases_without_iaf core2_aliases_without_iaf 575#define westmere_aliases core2_aliases 576#define westmere_aliases_without_iaf core2_aliases_without_iaf 577 578#define IAF_KW_OS "os" 579#define IAF_KW_USR "usr" 580#define IAF_KW_ANYTHREAD "anythread" --- 86 unchanged lines hidden (view full) --- 667}; 668 669static struct pmc_masks iap_transition_mask[] = { 670 PMCMASK(any, 0x00), 671 PMCMASK(frequency, 0x10), 672 NULLMASK 673}; 674 |
666static struct pmc_masks iap_rsp_mask[] = { | 675static struct pmc_masks iap_rsp_mask_i7_wm[] = { |
667 PMCMASK(DMND_DATA_RD, (1 << 0)), 668 PMCMASK(DMND_RFO, (1 << 1)), 669 PMCMASK(DMND_IFETCH, (1 << 2)), 670 PMCMASK(WB, (1 << 3)), 671 PMCMASK(PF_DATA_RD, (1 << 4)), 672 PMCMASK(PF_RFO, (1 << 5)), 673 PMCMASK(PF_IFETCH, (1 << 6)), 674 PMCMASK(OTHER, (1 << 7)), 675 PMCMASK(UNCORE_HIT, (1 << 8)), 676 PMCMASK(OTHER_CORE_HIT_SNP, (1 << 9)), 677 PMCMASK(OTHER_CORE_HITM, (1 << 10)), 678 PMCMASK(REMOTE_CACHE_FWD, (1 << 12)), 679 PMCMASK(REMOTE_DRAM, (1 << 13)), 680 PMCMASK(LOCAL_DRAM, (1 << 14)), 681 PMCMASK(NON_DRAM, (1 << 15)), 682 NULLMASK 683}; 684 | 676 PMCMASK(DMND_DATA_RD, (1 << 0)), 677 PMCMASK(DMND_RFO, (1 << 1)), 678 PMCMASK(DMND_IFETCH, (1 << 2)), 679 PMCMASK(WB, (1 << 3)), 680 PMCMASK(PF_DATA_RD, (1 << 4)), 681 PMCMASK(PF_RFO, (1 << 5)), 682 PMCMASK(PF_IFETCH, (1 << 6)), 683 PMCMASK(OTHER, (1 << 7)), 684 PMCMASK(UNCORE_HIT, (1 << 8)), 685 PMCMASK(OTHER_CORE_HIT_SNP, (1 << 9)), 686 PMCMASK(OTHER_CORE_HITM, (1 << 10)), 687 PMCMASK(REMOTE_CACHE_FWD, (1 << 12)), 688 PMCMASK(REMOTE_DRAM, (1 << 13)), 689 PMCMASK(LOCAL_DRAM, (1 << 14)), 690 PMCMASK(NON_DRAM, (1 << 15)), 691 NULLMASK 692}; 693 |
694static struct pmc_masks iap_rsp_mask_sb_ib[] = { 695 PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), 696 PMCMASK(REQ_DMND_RFO, (1ULL << 1)), 697 PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), 698 PMCMASK(REQ_WB, (1ULL << 3)), 699 PMCMASK(REQ_PF_DATA_RD, (1ULL << 4)), 700 PMCMASK(REQ_PF_RFO, (1ULL << 5)), 701 PMCMASK(REQ_PF_IFETCH, (1ULL << 6)), 702 PMCMASK(REQ_PF_LLC_DATA_RD, (1ULL << 7)), 703 PMCMASK(REQ_PF_LLC_RFO, (1ULL << 8)), 704 PMCMASK(REQ_PF_LLC_IFETCH, (1ULL << 9)), 705 PMCMASK(REQ_BUS_LOCKS, (1ULL << 10)), 706 PMCMASK(REQ_STRM_ST, (1ULL << 11)), 707 PMCMASK(REQ_OTHER, (1ULL << 15)), 708 PMCMASK(RES_ANY, (1ULL << 16)), 709 PMCMASK(RES_SUPPLIER_SUPP, (1ULL << 17)), 710 PMCMASK(RES_SUPPLIER_LLC_HITM, (1ULL << 18)), 711 PMCMASK(RES_SUPPLIER_LLC_HITE, (1ULL << 19)), 712 PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), 713 PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), 714 PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), 715 PMCMASK(RES_SNOOP_SNPI_NONE, (1ULL << 31)), 716 PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), 717 PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), 718 PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), 719 PMCMASK(RES_SNOOP_HIT_FWD, (1ULL << 35)), 720 PMCMASK(RES_SNOOP_HITM, (1ULL << 36)), 721 PMCMASK(RES_NON_DRAM, (1ULL << 37)), 722 NULLMASK 723}; 724 |
|
685static int 686iap_allocate_pmc(enum pmc_event pe, char *ctrspec, 687 struct pmc_op_pmcallocate *pmc_config) 688{ 689 char *e, *p, *q; | 725static int 726iap_allocate_pmc(enum pmc_event pe, char *ctrspec, 727 struct pmc_op_pmcallocate *pmc_config) 728{ 729 char *e, *p, *q; |
690 uint32_t cachestate, evmask, rsp; | 730 uint64_t cachestate, evmask, rsp; |
691 int count, n; 692 693 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE | 694 PMC_CAP_QUALIFIER); 695 pmc_config->pm_md.pm_iap.pm_iap_config = 0; 696 697 cachestate = evmask = rsp = 0; 698 --- 49 unchanged lines hidden (view full) --- 748 } else if (KWPREFIXMATCH(p, IAP_KW_SNOOPTYPE "=")) { 749 n = pmc_parse_mask(iap_snooptype_mask, p, 750 &evmask); 751 } else 752 return (-1); 753 } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7 || 754 cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE) { 755 if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { | 731 int count, n; 732 733 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE | 734 PMC_CAP_QUALIFIER); 735 pmc_config->pm_md.pm_iap.pm_iap_config = 0; 736 737 cachestate = evmask = rsp = 0; 738 --- 49 unchanged lines hidden (view full) --- 788 } else if (KWPREFIXMATCH(p, IAP_KW_SNOOPTYPE "=")) { 789 n = pmc_parse_mask(iap_snooptype_mask, p, 790 &evmask); 791 } else 792 return (-1); 793 } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7 || 794 cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE) { 795 if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { |
756 n = pmc_parse_mask(iap_rsp_mask, p, &rsp); | 796 n = pmc_parse_mask(iap_rsp_mask_i7_wm, p, &rsp); |
757 } else 758 return (-1); | 797 } else 798 return (-1); |
799 } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || 800 cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { 801 if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { 802 n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp); 803 } else 804 return (-1); |
|
759 } else 760 return (-1); 761 762 if (n < 0) /* Parsing failed. */ 763 return (-1); 764 } 765 766 pmc_config->pm_md.pm_iap.pm_iap_config |= evmask; --- 300 unchanged lines hidden (view full) --- 1067#define K8_KW_USR "usr" 1068 1069static int 1070k8_allocate_pmc(enum pmc_event pe, char *ctrspec, 1071 struct pmc_op_pmcallocate *pmc_config) 1072{ 1073 char *e, *p, *q; 1074 int n; | 805 } else 806 return (-1); 807 808 if (n < 0) /* Parsing failed. */ 809 return (-1); 810 } 811 812 pmc_config->pm_md.pm_iap.pm_iap_config |= evmask; --- 300 unchanged lines hidden (view full) --- 1113#define K8_KW_USR "usr" 1114 1115static int 1116k8_allocate_pmc(enum pmc_event pe, char *ctrspec, 1117 struct pmc_op_pmcallocate *pmc_config) 1118{ 1119 char *e, *p, *q; 1120 int n; |
1075 uint32_t count, evmask; | 1121 uint32_t count; 1122 uint64_t evmask; |
1076 const struct pmc_masks *pm, *pmask; 1077 1078 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 1079 pmc_config->pm_md.pm_amd.pm_amd_config = 0; 1080 1081 pmask = NULL; 1082 evmask = 0; 1083 --- 465 unchanged lines hidden (view full) --- 1549/* P4 event parser */ 1550static int 1551p4_allocate_pmc(enum pmc_event pe, char *ctrspec, 1552 struct pmc_op_pmcallocate *pmc_config) 1553{ 1554 1555 char *e, *p, *q; 1556 int count, has_tag, has_busreqtype, n; | 1123 const struct pmc_masks *pm, *pmask; 1124 1125 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 1126 pmc_config->pm_md.pm_amd.pm_amd_config = 0; 1127 1128 pmask = NULL; 1129 evmask = 0; 1130 --- 465 unchanged lines hidden (view full) --- 1596/* P4 event parser */ 1597static int 1598p4_allocate_pmc(enum pmc_event pe, char *ctrspec, 1599 struct pmc_op_pmcallocate *pmc_config) 1600{ 1601 1602 char *e, *p, *q; 1603 int count, has_tag, has_busreqtype, n; |
1557 uint32_t evmask, cccractivemask; | 1604 uint32_t cccractivemask; 1605 uint64_t evmask; |
1558 const struct pmc_masks *pm, *pmask; 1559 1560 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 1561 pmc_config->pm_md.pm_p4.pm_p4_cccrconfig = 1562 pmc_config->pm_md.pm_p4.pm_p4_escrconfig = 0; 1563 1564 pmask = NULL; 1565 evmask = 0; --- 411 unchanged lines hidden (view full) --- 1977}; 1978 1979/* P6 event parser */ 1980static int 1981p6_allocate_pmc(enum pmc_event pe, char *ctrspec, 1982 struct pmc_op_pmcallocate *pmc_config) 1983{ 1984 char *e, *p, *q; | 1606 const struct pmc_masks *pm, *pmask; 1607 1608 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 1609 pmc_config->pm_md.pm_p4.pm_p4_cccrconfig = 1610 pmc_config->pm_md.pm_p4.pm_p4_escrconfig = 0; 1611 1612 pmask = NULL; 1613 evmask = 0; --- 411 unchanged lines hidden (view full) --- 2025}; 2026 2027/* P6 event parser */ 2028static int 2029p6_allocate_pmc(enum pmc_event pe, char *ctrspec, 2030 struct pmc_op_pmcallocate *pmc_config) 2031{ 2032 char *e, *p, *q; |
1985 uint32_t evmask; | 2033 uint64_t evmask; |
1986 int count, n; 1987 const struct pmc_masks *pm, *pmask; 1988 1989 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 1990 pmc_config->pm_md.pm_ppro.pm_ppro_config = 0; 1991 1992 evmask = 0; 1993 --- 623 unchanged lines hidden (view full) --- 2617 case PMC_CPU_INTEL_CORE2EXTREME: 2618 ev = core2_event_table; 2619 count = PMC_EVENT_TABLE_SIZE(core2); 2620 break; 2621 case PMC_CPU_INTEL_COREI7: 2622 ev = corei7_event_table; 2623 count = PMC_EVENT_TABLE_SIZE(corei7); 2624 break; | 2034 int count, n; 2035 const struct pmc_masks *pm, *pmask; 2036 2037 pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); 2038 pmc_config->pm_md.pm_ppro.pm_ppro_config = 0; 2039 2040 evmask = 0; 2041 --- 623 unchanged lines hidden (view full) --- 2665 case PMC_CPU_INTEL_CORE2EXTREME: 2666 ev = core2_event_table; 2667 count = PMC_EVENT_TABLE_SIZE(core2); 2668 break; 2669 case PMC_CPU_INTEL_COREI7: 2670 ev = corei7_event_table; 2671 count = PMC_EVENT_TABLE_SIZE(corei7); 2672 break; |
2673 case PMC_CPU_INTEL_IVYBRIDGE: 2674 ev = ivybridge_event_table; 2675 count = PMC_EVENT_TABLE_SIZE(ivybridge); 2676 break; |
|
2625 case PMC_CPU_INTEL_SANDYBRIDGE: 2626 ev = sandybridge_event_table; 2627 count = PMC_EVENT_TABLE_SIZE(sandybridge); 2628 break; 2629 case PMC_CPU_INTEL_WESTMERE: 2630 ev = westmere_event_table; 2631 count = PMC_EVENT_TABLE_SIZE(westmere); 2632 break; --- 276 unchanged lines hidden (view full) --- 2909 case PMC_CPU_INTEL_CORE2EXTREME: 2910 PMC_MDEP_INIT_INTEL_V2(core2); 2911 break; 2912 case PMC_CPU_INTEL_COREI7: 2913 pmc_class_table[n++] = &ucf_class_table_descr; 2914 pmc_class_table[n++] = &corei7uc_class_table_descr; 2915 PMC_MDEP_INIT_INTEL_V2(corei7); 2916 break; | 2677 case PMC_CPU_INTEL_SANDYBRIDGE: 2678 ev = sandybridge_event_table; 2679 count = PMC_EVENT_TABLE_SIZE(sandybridge); 2680 break; 2681 case PMC_CPU_INTEL_WESTMERE: 2682 ev = westmere_event_table; 2683 count = PMC_EVENT_TABLE_SIZE(westmere); 2684 break; --- 276 unchanged lines hidden (view full) --- 2961 case PMC_CPU_INTEL_CORE2EXTREME: 2962 PMC_MDEP_INIT_INTEL_V2(core2); 2963 break; 2964 case PMC_CPU_INTEL_COREI7: 2965 pmc_class_table[n++] = &ucf_class_table_descr; 2966 pmc_class_table[n++] = &corei7uc_class_table_descr; 2967 PMC_MDEP_INIT_INTEL_V2(corei7); 2968 break; |
2969 case PMC_CPU_INTEL_IVYBRIDGE: 2970 PMC_MDEP_INIT_INTEL_V2(ivybridge); 2971 break; |
|
2917 case PMC_CPU_INTEL_SANDYBRIDGE: 2918 pmc_class_table[n++] = &ucf_class_table_descr; 2919 pmc_class_table[n++] = &sandybridgeuc_class_table_descr; 2920 PMC_MDEP_INIT_INTEL_V2(sandybridge); 2921 break; 2922 case PMC_CPU_INTEL_WESTMERE: 2923 pmc_class_table[n++] = &ucf_class_table_descr; 2924 pmc_class_table[n++] = &westmereuc_class_table_descr; --- 119 unchanged lines hidden (view full) --- 3044 case PMC_CPU_INTEL_CORE2EXTREME: 3045 ev = core2_event_table; 3046 evfence = core2_event_table + PMC_EVENT_TABLE_SIZE(core2); 3047 break; 3048 case PMC_CPU_INTEL_COREI7: 3049 ev = corei7_event_table; 3050 evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); 3051 break; | 2972 case PMC_CPU_INTEL_SANDYBRIDGE: 2973 pmc_class_table[n++] = &ucf_class_table_descr; 2974 pmc_class_table[n++] = &sandybridgeuc_class_table_descr; 2975 PMC_MDEP_INIT_INTEL_V2(sandybridge); 2976 break; 2977 case PMC_CPU_INTEL_WESTMERE: 2978 pmc_class_table[n++] = &ucf_class_table_descr; 2979 pmc_class_table[n++] = &westmereuc_class_table_descr; --- 119 unchanged lines hidden (view full) --- 3099 case PMC_CPU_INTEL_CORE2EXTREME: 3100 ev = core2_event_table; 3101 evfence = core2_event_table + PMC_EVENT_TABLE_SIZE(core2); 3102 break; 3103 case PMC_CPU_INTEL_COREI7: 3104 ev = corei7_event_table; 3105 evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); 3106 break; |
3107 case PMC_CPU_INTEL_IVYBRIDGE: 3108 ev = ivybridge_event_table; 3109 evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); 3110 break; |
|
3052 case PMC_CPU_INTEL_SANDYBRIDGE: 3053 ev = sandybridge_event_table; 3054 evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); 3055 break; 3056 case PMC_CPU_INTEL_WESTMERE: 3057 ev = westmere_event_table; 3058 evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); 3059 break; --- 260 unchanged lines hidden --- | 3111 case PMC_CPU_INTEL_SANDYBRIDGE: 3112 ev = sandybridge_event_table; 3113 evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); 3114 break; 3115 case PMC_CPU_INTEL_WESTMERE: 3116 ev = westmere_event_table; 3117 evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); 3118 break; --- 260 unchanged lines hidden --- |