16 #ifndef CPUCounters_TYPES_H
17 #define CPUCounters_TYPES_H
25 #define COMPILE_FOR_WINDOWS_7
34 typedef unsigned long long uint64;
35 typedef signed long long int64;
36 typedef unsigned int uint32;
37 typedef signed int int32;
46 #define INST_RETIRED_ANY_ADDR (0x309)
47 #define CPU_CLK_UNHALTED_THREAD_ADDR (0x30A)
48 #define CPU_CLK_UNHALTED_REF_ADDR (0x30B)
49 #define IA32_CR_PERF_GLOBAL_CTRL (0x38F)
50 #define IA32_CR_FIXED_CTR_CTRL (0x38D)
51 #define IA32_PERFEVTSEL0_ADDR (0x186)
52 #define IA32_PERFEVTSEL1_ADDR (IA32_PERFEVTSEL0_ADDR + 1)
53 #define IA32_PERFEVTSEL2_ADDR (IA32_PERFEVTSEL0_ADDR + 2)
54 #define IA32_PERFEVTSEL3_ADDR (IA32_PERFEVTSEL0_ADDR + 3)
56 #define PERF_MAX_COUNTERS (7)
58 #define IA32_DEBUGCTL (0x1D9)
60 #define IA32_PMC0 (0xC1)
61 #define IA32_PMC1 (0xC1 + 1)
62 #define IA32_PMC2 (0xC1 + 2)
63 #define IA32_PMC3 (0xC1 + 3)
65 #define MSR_OFFCORE_RSP0 (0x1A6)
66 #define MSR_OFFCORE_RSP1 (0x1A7)
69 #define PLATFORM_INFO_ADDR (0xCE)
71 #define IA32_TIME_STAMP_COUNTER (0x10)
76 #define MEM_LOAD_RETIRED_L3_MISS_EVTNR (0xCB)
77 #define MEM_LOAD_RETIRED_L3_MISS_UMASK (0x10)
79 #define MEM_LOAD_RETIRED_L3_UNSHAREDHIT_EVTNR (0xCB)
80 #define MEM_LOAD_RETIRED_L3_UNSHAREDHIT_UMASK (0x04)
82 #define MEM_LOAD_RETIRED_L2_HITM_EVTNR (0xCB)
83 #define MEM_LOAD_RETIRED_L2_HITM_UMASK (0x08)
85 #define MEM_LOAD_RETIRED_L2_HIT_EVTNR (0xCB)
86 #define MEM_LOAD_RETIRED_L2_HIT_UMASK (0x02)
90 #define MEM_LOAD_UOPS_MISC_RETIRED_LLC_MISS_EVTNR (0xD4)
91 #define MEM_LOAD_UOPS_MISC_RETIRED_LLC_MISS_UMASK (0x02)
93 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_NONE_EVTNR (0xD2)
94 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_NONE_UMASK (0x08)
96 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_HITM_EVTNR (0xD2)
97 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_HITM_UMASK (0x04)
99 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_EVTNR (0xD2)
100 #define MEM_LOAD_UOPS_LLC_HIT_RETIRED_XSNP_UMASK (0x07)
102 #define MEM_LOAD_UOPS_RETIRED_L2_HIT_EVTNR (0xD1)
103 #define MEM_LOAD_UOPS_RETIRED_L2_HIT_UMASK (0x02)
107 #define ARCH_LLC_REFERENCE_EVTNR (0x2E)
108 #define ARCH_LLC_REFERENCE_UMASK (0x4F)
110 #define ARCH_LLC_MISS_EVTNR (0x2E)
111 #define ARCH_LLC_MISS_UMASK (0x41)
115 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_EVTNR (0xCB)
116 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_UMASK (0x01)
118 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_EVTNR (0xCB)
119 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_UMASK (0x02)
121 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_EVTNR (0xCB)
122 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_UMASK (0x01)
124 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_EVTNR (0xCB)
125 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_UMASK (0x02)
127 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_EVTNR (0xCB)
128 #define ATOM_MEM_LOAD_RETIRED_L2_HIT_UMASK (0x01)
130 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_EVTNR (0xCB)
131 #define ATOM_MEM_LOAD_RETIRED_L2_MISS_UMASK (0x02)
139 #define MSR_UNCORE_PERF_GLOBAL_CTRL_ADDR (0x391)
141 #define MSR_UNCORE_PERFEVTSEL0_ADDR (0x3C0)
142 #define MSR_UNCORE_PERFEVTSEL1_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 1)
143 #define MSR_UNCORE_PERFEVTSEL2_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 2)
144 #define MSR_UNCORE_PERFEVTSEL3_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 3)
145 #define MSR_UNCORE_PERFEVTSEL4_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 4)
146 #define MSR_UNCORE_PERFEVTSEL5_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 5)
147 #define MSR_UNCORE_PERFEVTSEL6_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 6)
148 #define MSR_UNCORE_PERFEVTSEL7_ADDR (MSR_UNCORE_PERFEVTSEL0_ADDR + 7)
151 #define MSR_UNCORE_PMC0 (0x3B0)
152 #define MSR_UNCORE_PMC1 (MSR_UNCORE_PMC0 + 1)
153 #define MSR_UNCORE_PMC2 (MSR_UNCORE_PMC0 + 2)
154 #define MSR_UNCORE_PMC3 (MSR_UNCORE_PMC0 + 3)
155 #define MSR_UNCORE_PMC4 (MSR_UNCORE_PMC0 + 4)
156 #define MSR_UNCORE_PMC5 (MSR_UNCORE_PMC0 + 5)
157 #define MSR_UNCORE_PMC6 (MSR_UNCORE_PMC0 + 6)
158 #define MSR_UNCORE_PMC7 (MSR_UNCORE_PMC0 + 7)
162 #define UNC_QMC_WRITES_FULL_ANY_EVTNR (0x2F)
163 #define UNC_QMC_WRITES_FULL_ANY_UMASK (0x07)
165 #define UNC_QMC_NORMAL_READS_ANY_EVTNR (0x2C)
166 #define UNC_QMC_NORMAL_READS_ANY_UMASK (0x07)
168 #define UNC_QHL_REQUESTS_EVTNR (0x20)
170 #define UNC_QHL_REQUESTS_IOH_READS_UMASK (0x01)
171 #define UNC_QHL_REQUESTS_IOH_WRITES_UMASK (0x02)
172 #define UNC_QHL_REQUESTS_REMOTE_READS_UMASK (0x04)
173 #define UNC_QHL_REQUESTS_REMOTE_WRITES_UMASK (0x08)
174 #define UNC_QHL_REQUESTS_LOCAL_READS_UMASK (0x10)
175 #define UNC_QHL_REQUESTS_LOCAL_WRITES_UMASK (0x20)
183 #define U_MSR_PMON_GLOBAL_CTL (0x0C00)
185 #define MB0_MSR_PERF_GLOBAL_CTL (0x0CA0)
186 #define MB0_MSR_PMU_CNT_0 (0x0CB1)
187 #define MB0_MSR_PMU_CNT_CTL_0 (0x0CB0)
188 #define MB0_MSR_PMU_CNT_1 (0x0CB3)
189 #define MB0_MSR_PMU_CNT_CTL_1 (0x0CB2)
190 #define MB0_MSR_PMU_ZDP_CTL_FVC (0x0CAB)
193 #define MB1_MSR_PERF_GLOBAL_CTL (0x0CE0)
194 #define MB1_MSR_PMU_CNT_0 (0x0CF1)
195 #define MB1_MSR_PMU_CNT_CTL_0 (0x0CF0)
196 #define MB1_MSR_PMU_CNT_1 (0x0CF3)
197 #define MB1_MSR_PMU_CNT_CTL_1 (0x0CF2)
198 #define MB1_MSR_PMU_ZDP_CTL_FVC (0x0CEB)
200 #define BB0_MSR_PERF_GLOBAL_CTL (0x0C20)
201 #define BB0_MSR_PERF_CNT_1 (0x0C33)
202 #define BB0_MSR_PERF_CNT_CTL_1 (0x0C32)
204 #define BB1_MSR_PERF_GLOBAL_CTL (0x0C60)
205 #define BB1_MSR_PERF_CNT_1 (0x0C73)
206 #define BB1_MSR_PERF_CNT_CTL_1 (0x0C72)
208 #define R_MSR_PMON_CTL0 (0x0E10)
209 #define R_MSR_PMON_CTR0 (0x0E11)
210 #define R_MSR_PMON_CTL1 (0x0E12)
211 #define R_MSR_PMON_CTR1 (0x0E13)
212 #define R_MSR_PMON_CTL2 (0x0E14)
213 #define R_MSR_PMON_CTR2 (0x0E15)
214 #define R_MSR_PMON_CTL3 (0x0E16)
215 #define R_MSR_PMON_CTR3 (0x0E17)
216 #define R_MSR_PMON_CTL4 (0x0E18)
217 #define R_MSR_PMON_CTR4 (0x0E19)
218 #define R_MSR_PMON_CTL5 (0x0E1A)
219 #define R_MSR_PMON_CTR5 (0x0E1B)
220 #define R_MSR_PMON_CTL6 (0x0E1C)
221 #define R_MSR_PMON_CTR6 (0x0E1D)
222 #define R_MSR_PMON_CTL7 (0x0E1E)
223 #define R_MSR_PMON_CTR7 (0x0E1F)
224 #define R_MSR_PMON_CTL8 (0x0E30)
225 #define R_MSR_PMON_CTR8 (0x0E31)
226 #define R_MSR_PMON_CTL9 (0x0E32)
227 #define R_MSR_PMON_CTR9 (0x0E33)
228 #define R_MSR_PMON_CTL10 (0x0E34)
229 #define R_MSR_PMON_CTR10 (0x0E35)
230 #define R_MSR_PMON_CTL11 (0x0E36)
231 #define R_MSR_PMON_CTR11 (0x0E37)
232 #define R_MSR_PMON_CTL12 (0x0E38)
233 #define R_MSR_PMON_CTR12 (0x0E39)
234 #define R_MSR_PMON_CTL13 (0x0E3A)
235 #define R_MSR_PMON_CTR13 (0x0E3B)
236 #define R_MSR_PMON_CTL14 (0x0E3C)
237 #define R_MSR_PMON_CTR14 (0x0E3D)
238 #define R_MSR_PMON_CTL15 (0x0E3E)
239 #define R_MSR_PMON_CTR15 (0x0E3F)
241 #define R_MSR_PORT0_IPERF_CFG0 (0x0E04)
242 #define R_MSR_PORT1_IPERF_CFG0 (0x0E05)
243 #define R_MSR_PORT2_IPERF_CFG0 (0x0E06)
244 #define R_MSR_PORT3_IPERF_CFG0 (0x0E07)
245 #define R_MSR_PORT4_IPERF_CFG0 (0x0E08)
246 #define R_MSR_PORT5_IPERF_CFG0 (0x0E09)
247 #define R_MSR_PORT6_IPERF_CFG0 (0x0E0A)
248 #define R_MSR_PORT7_IPERF_CFG0 (0x0E0B)
250 #define R_MSR_PORT0_IPERF_CFG1 (0x0E24)
251 #define R_MSR_PORT1_IPERF_CFG1 (0x0E25)
252 #define R_MSR_PORT2_IPERF_CFG1 (0x0E26)
253 #define R_MSR_PORT3_IPERF_CFG1 (0x0E27)
254 #define R_MSR_PORT4_IPERF_CFG1 (0x0E28)
255 #define R_MSR_PORT5_IPERF_CFG1 (0x0E29)
256 #define R_MSR_PORT6_IPERF_CFG1 (0x0E2A)
257 #define R_MSR_PORT7_IPERF_CFG1 (0x0E2B)
259 #define R_MSR_PMON_GLOBAL_CTL_7_0 (0x0E00)
260 #define R_MSR_PMON_GLOBAL_CTL_15_8 (0x0E20)
262 #define W_MSR_PMON_GLOBAL_CTL (0xC80)
263 #define W_MSR_PMON_FIXED_CTR_CTL (0x395)
264 #define W_MSR_PMON_FIXED_CTR (0x394)
270 #define IA32_PQR_ASSOC (0xc8f)
271 #define IA32_QM_EVTSEL (0xc8d)
272 #define IA32_QM_CTR (0xc8e)
274 #define PCM_INVALID_L3_CACHE_OCCUPANCY ((std::numeric_limits<uint64>::max)())
289 uint64 event_select : 8;
294 uint64 pin_control : 1;
296 uint64 any_thread : 1;
302 uint64 reservedX : 30;
325 uint64 any_thread0 : 1;
326 uint64 enable_pmi0 : 1;
330 uint64 any_thread1 : 1;
331 uint64 enable_pmi1 : 1;
335 uint64 any_thread2 : 1;
336 uint64 enable_pmi2 : 1;
338 uint64 reserved1 : 52;
346 o <<
"os0\t\t" << reg.fields.os0 << std::endl;
347 o <<
"usr0\t\t" << reg.fields.usr0 << std::endl;
348 o <<
"any_thread0\t" << reg.fields.any_thread0 << std::endl;
349 o <<
"enable_pmi0\t" << reg.fields.enable_pmi0 << std::endl;
351 o <<
"os1\t\t" << reg.fields.os1 << std::endl;
352 o <<
"usr1\t\t" << reg.fields.usr1 << std::endl;
353 o <<
"any_thread1\t" << reg.fields.any_thread1 << std::endl;
354 o <<
"enable_pmi10\t" << reg.fields.enable_pmi1 << std::endl;
356 o <<
"os2\t\t" << reg.fields.os2 << std::endl;
357 o <<
"usr2\t\t" << reg.fields.usr2 << std::endl;
358 o <<
"any_thread2\t" << reg.fields.any_thread2 << std::endl;
359 o <<
"enable_pmi2\t" << reg.fields.enable_pmi2 << std::endl;
361 o <<
"reserved1\t" << reg.fields.reserved1 << std::endl;
379 uint64 event_select : 8;
381 uint64 reserved1 : 1;
382 uint64 occ_ctr_rst : 1;
384 uint64 reserved2 : 1;
385 uint64 enable_pmi : 1;
386 uint64 reserved3 : 1;
390 uint64 reservedx : 32;
414 uint64 pbox_init_err : 1;
425 uint64 pbox_init_err : 1;
444 uint64 count_mode : 2;
445 uint64 storage_mode : 2;
446 uint64 wrap_mode : 1;
447 uint64 flag_mode : 1;
451 uint64 set_flag_sel : 3;
460 #define MSR_PKG_ENERGY_STATUS (0x611)
461 #define MSR_RAPL_POWER_UNIT (0x606)
462 #define MSR_PKG_POWER_INFO (0x614)
464 #define PCM_INTEL_PCI_VENDOR_ID (0x8086)
465 #define PCM_PCI_VENDOR_ID_OFFSET (0)
469 #define JKTIVT_MC0_CH0_REGISTER_DEV_ADDR (16)
470 #define JKTIVT_MC0_CH1_REGISTER_DEV_ADDR (16)
471 #define JKTIVT_MC0_CH2_REGISTER_DEV_ADDR (16)
472 #define JKTIVT_MC0_CH3_REGISTER_DEV_ADDR (16)
473 #define JKTIVT_MC0_CH0_REGISTER_FUNC_ADDR (4)
474 #define JKTIVT_MC0_CH1_REGISTER_FUNC_ADDR (5)
475 #define JKTIVT_MC0_CH2_REGISTER_FUNC_ADDR (0)
476 #define JKTIVT_MC0_CH3_REGISTER_FUNC_ADDR (1)
478 #define JKTIVT_MC1_CH0_REGISTER_DEV_ADDR (30)
479 #define JKTIVT_MC1_CH1_REGISTER_DEV_ADDR (30)
480 #define JKTIVT_MC1_CH2_REGISTER_DEV_ADDR (30)
481 #define JKTIVT_MC1_CH3_REGISTER_DEV_ADDR (30)
482 #define JKTIVT_MC1_CH0_REGISTER_FUNC_ADDR (4)
483 #define JKTIVT_MC1_CH1_REGISTER_FUNC_ADDR (5)
484 #define JKTIVT_MC1_CH2_REGISTER_FUNC_ADDR (0)
485 #define JKTIVT_MC1_CH3_REGISTER_FUNC_ADDR (1)
487 #define HSX_MC0_CH0_REGISTER_DEV_ADDR (20)
488 #define HSX_MC0_CH1_REGISTER_DEV_ADDR (20)
489 #define HSX_MC0_CH2_REGISTER_DEV_ADDR (21)
490 #define HSX_MC0_CH3_REGISTER_DEV_ADDR (21)
491 #define HSX_MC0_CH0_REGISTER_FUNC_ADDR (0)
492 #define HSX_MC0_CH1_REGISTER_FUNC_ADDR (1)
493 #define HSX_MC0_CH2_REGISTER_FUNC_ADDR (0)
494 #define HSX_MC0_CH3_REGISTER_FUNC_ADDR (1)
496 #define HSX_MC1_CH0_REGISTER_DEV_ADDR (23)
497 #define HSX_MC1_CH1_REGISTER_DEV_ADDR (23)
498 #define HSX_MC1_CH2_REGISTER_DEV_ADDR (24)
499 #define HSX_MC1_CH3_REGISTER_DEV_ADDR (24)
500 #define HSX_MC1_CH0_REGISTER_FUNC_ADDR (0)
501 #define HSX_MC1_CH1_REGISTER_FUNC_ADDR (1)
502 #define HSX_MC1_CH2_REGISTER_FUNC_ADDR (0)
503 #define HSX_MC1_CH3_REGISTER_FUNC_ADDR (1)
505 #define MC_CH_PCI_PMON_BOX_CTL_ADDR (0x0F4)
507 #define MC_CH_PCI_PMON_FIXED_CTL_ADDR (0x0F0)
508 #define MC_CH_PCI_PMON_CTL3_ADDR (0x0E4)
509 #define MC_CH_PCI_PMON_CTL2_ADDR (0x0E0)
510 #define MC_CH_PCI_PMON_CTL1_ADDR (0x0DC)
511 #define MC_CH_PCI_PMON_CTL0_ADDR (0x0D8)
513 #define MC_CH_PCI_PMON_FIXED_CTR_ADDR (0x0D0)
514 #define MC_CH_PCI_PMON_CTR3_ADDR (0x0B8)
515 #define MC_CH_PCI_PMON_CTR2_ADDR (0x0B0)
516 #define MC_CH_PCI_PMON_CTR1_ADDR (0x0A8)
517 #define MC_CH_PCI_PMON_CTR0_ADDR (0x0A0)
519 #define JKTIVT_QPI_PORT0_REGISTER_DEV_ADDR (8)
520 #define JKTIVT_QPI_PORT0_REGISTER_FUNC_ADDR (2)
521 #define JKTIVT_QPI_PORT1_REGISTER_DEV_ADDR (9)
522 #define JKTIVT_QPI_PORT1_REGISTER_FUNC_ADDR (2)
523 #define JKTIVT_QPI_PORT2_REGISTER_DEV_ADDR (24)
524 #define JKTIVT_QPI_PORT2_REGISTER_FUNC_ADDR (2)
526 #define HSX_QPI_PORT0_REGISTER_DEV_ADDR (8)
527 #define HSX_QPI_PORT0_REGISTER_FUNC_ADDR (2)
528 #define HSX_QPI_PORT1_REGISTER_DEV_ADDR (9)
529 #define HSX_QPI_PORT1_REGISTER_FUNC_ADDR (2)
530 #define HSX_QPI_PORT2_REGISTER_DEV_ADDR (10)
531 #define HSX_QPI_PORT2_REGISTER_FUNC_ADDR (2)
533 #define QPI_PORT0_MISC_REGISTER_FUNC_ADDR (0)
534 #define QPI_PORT1_MISC_REGISTER_FUNC_ADDR (0)
535 #define QPI_PORT2_MISC_REGISTER_FUNC_ADDR (0)
537 #define Q_P_PCI_PMON_BOX_CTL_ADDR (0x0F4)
539 #define Q_P_PCI_PMON_CTL3_ADDR (0x0E4)
540 #define Q_P_PCI_PMON_CTL2_ADDR (0x0E0)
541 #define Q_P_PCI_PMON_CTL1_ADDR (0x0DC)
542 #define Q_P_PCI_PMON_CTL0_ADDR (0x0D8)
544 #define Q_P_PCI_PMON_CTR3_ADDR (0x0B8)
545 #define Q_P_PCI_PMON_CTR2_ADDR (0x0B0)
546 #define Q_P_PCI_PMON_CTR1_ADDR (0x0A8)
547 #define Q_P_PCI_PMON_CTR0_ADDR (0x0A0)
549 #define QPI_RATE_STATUS_ADDR (0x0D4)
551 #define JKTIVT_PCU_MSR_PMON_CTR3_ADDR (0x0C39)
552 #define JKTIVT_PCU_MSR_PMON_CTR2_ADDR (0x0C38)
553 #define JKTIVT_PCU_MSR_PMON_CTR1_ADDR (0x0C37)
554 #define JKTIVT_PCU_MSR_PMON_CTR0_ADDR (0x0C36)
556 #define JKTIVT_PCU_MSR_PMON_BOX_FILTER_ADDR (0x0C34)
558 #define JKTIVT_PCU_MSR_PMON_CTL3_ADDR (0x0C33)
559 #define JKTIVT_PCU_MSR_PMON_CTL2_ADDR (0x0C32)
560 #define JKTIVT_PCU_MSR_PMON_CTL1_ADDR (0x0C31)
561 #define JKTIVT_PCU_MSR_PMON_CTL0_ADDR (0x0C30)
563 #define JKTIVT_PCU_MSR_PMON_BOX_CTL_ADDR (0x0C24)
565 #define HSX_PCU_MSR_PMON_CTR3_ADDR (0x071A)
566 #define HSX_PCU_MSR_PMON_CTR2_ADDR (0x0719)
567 #define HSX_PCU_MSR_PMON_CTR1_ADDR (0x0718)
568 #define HSX_PCU_MSR_PMON_CTR0_ADDR (0x0717)
570 #define HSX_PCU_MSR_PMON_BOX_FILTER_ADDR (0x0715)
572 #define HSX_PCU_MSR_PMON_CTL3_ADDR (0x0714)
573 #define HSX_PCU_MSR_PMON_CTL2_ADDR (0x0713)
574 #define HSX_PCU_MSR_PMON_CTL1_ADDR (0x0712)
575 #define HSX_PCU_MSR_PMON_CTL0_ADDR (0x0711)
577 #define HSX_PCU_MSR_PMON_BOX_CTL_ADDR (0x0710)
579 #define MC_CH_PCI_PMON_BOX_CTL_RST_CONTROL (1<<0)
580 #define MC_CH_PCI_PMON_BOX_CTL_RST_COUNTERS (1<<1)
581 #define MC_CH_PCI_PMON_BOX_CTL_FRZ (1<<8)
582 #define MC_CH_PCI_PMON_BOX_CTL_FRZ_EN (1<<16)
584 #define UNCORE_PMON_BOX_CTL_VALID_BITS_MASK ((1<<17)-1)
586 #define MC_CH_PCI_PMON_FIXED_CTL_RST (1<<19)
587 #define MC_CH_PCI_PMON_FIXED_CTL_EN (1<<22)
589 #define MC_CH_PCI_PMON_CTL_EVENT(x) (x<<0)
590 #define MC_CH_PCI_PMON_CTL_UMASK(x) (x<<8)
591 #define MC_CH_PCI_PMON_CTL_RST (1<<17)
592 #define MC_CH_PCI_PMON_CTL_EDGE_DET (1<<18)
593 #define MC_CH_PCI_PMON_CTL_EN (1<<22)
594 #define MC_CH_PCI_PMON_CTL_INVERT (1<<23)
595 #define MC_CH_PCI_PMON_CTL_THRESH(x) (x<<24UL)
597 #define Q_P_PCI_PMON_BOX_CTL_RST_CONTROL (1<<0)
598 #define Q_P_PCI_PMON_BOX_CTL_RST_COUNTERS (1<<1)
599 #define Q_P_PCI_PMON_BOX_CTL_RST_FRZ (1<<8)
600 #define Q_P_PCI_PMON_BOX_CTL_RST_FRZ_EN (1<<16)
602 #define Q_P_PCI_PMON_CTL_EVENT(x) (x<<0)
603 #define Q_P_PCI_PMON_CTL_UMASK(x) (x<<8)
604 #define Q_P_PCI_PMON_CTL_RST (1<<17)
605 #define Q_P_PCI_PMON_CTL_EDGE_DET (1<<18)
606 #define Q_P_PCI_PMON_CTL_EVENT_EXT (1<<21)
607 #define Q_P_PCI_PMON_CTL_EN (1<<22)
608 #define Q_P_PCI_PMON_CTL_INVERT (1<<23)
609 #define Q_P_PCI_PMON_CTL_THRESH(x) (x<<24UL)
611 #define PCU_MSR_PMON_BOX_FILTER_BAND_0(x) (x<<0)
612 #define PCU_MSR_PMON_BOX_FILTER_BAND_1(x) (x<<8)
613 #define PCU_MSR_PMON_BOX_FILTER_BAND_2(x) (x<<16)
614 #define PCU_MSR_PMON_BOX_FILTER_BAND_3(x) (x<<24)
616 #define PCU_MSR_PMON_BOX_CTL_RST_CONTROL (1<<0)
617 #define PCU_MSR_PMON_BOX_CTL_RST_COUNTERS (1<<1)
618 #define PCU_MSR_PMON_BOX_CTL_FRZ (1<<8)
619 #define PCU_MSR_PMON_BOX_CTL_FRZ_EN (1<<16)
621 #define PCU_MSR_PMON_CTL_EVENT(x) (x<<0)
622 #define PCU_MSR_PMON_CTL_OCC_SEL(x) (x<<14)
623 #define PCU_MSR_PMON_CTL_RST (1<<17)
624 #define PCU_MSR_PMON_CTL_EDGE_DET (1<<18)
625 #define PCU_MSR_PMON_CTL_EXTRA_SEL (1<<21)
626 #define PCU_MSR_PMON_CTL_EN (1<<22)
627 #define PCU_MSR_PMON_CTL_INVERT (1<<23)
628 #define PCU_MSR_PMON_CTL_THRESH(x) (x<<24UL)
629 #define PCU_MSR_PMON_CTL_OCC_INVERT (1UL<<30UL)
630 #define PCU_MSR_PMON_CTL_OCC_EDGE_DET (1UL<<31UL)
633 #define JKT_C0_MSR_PMON_CTR3 0x0D19 // CBo 0 PMON Counter 3
634 #define JKT_C0_MSR_PMON_CTR2 0x0D18 // CBo 0 PMON Counter 2
635 #define JKT_C0_MSR_PMON_CTR1 0x0D17 // CBo 0 PMON Counter 1
636 #define JKT_C0_MSR_PMON_CTR0 0x0D16 // CBo 0 PMON Counter 0
637 #define JKT_C0_MSR_PMON_BOX_FILTER 0x0D14 // CBo 0 PMON Filter
638 #define JKT_C0_MSR_PMON_CTL3 0x0D13 // CBo 0 PMON Control for Counter 3
639 #define JKT_C0_MSR_PMON_CTL2 0x0D12 // CBo 0 PMON Control for Counter 2
640 #define JKT_C0_MSR_PMON_CTL1 0x0D11 // CBo 0 PMON Control for Counter 1
641 #define JKT_C0_MSR_PMON_CTL0 0x0D10 // CBo 0 PMON Control for Counter 0
642 #define JKT_C0_MSR_PMON_BOX_CTL 0x0D04 // CBo 0 PMON Box-Wide Control
644 #define JKTIVT_CBO_MSR_STEP 0x0020 // CBo MSR Step
646 #define IVT_C0_MSR_PMON_BOX_FILTER1 0x0D1A // CBo 0 PMON Filter 1
648 #define HSX_C0_MSR_PMON_CTR3 0x0E0B // CBo 0 PMON Counter 3
649 #define HSX_C0_MSR_PMON_CTR2 0x0E0A // CBo 0 PMON Counter 2
650 #define HSX_C0_MSR_PMON_CTR1 0x0E09 // CBo 0 PMON Counter 1
651 #define HSX_C0_MSR_PMON_CTR0 0x0E08 // CBo 0 PMON Counter 0
653 #define HSX_C0_MSR_PMON_BOX_FILTER1 0x0E06 // CBo 0 PMON Filter1
654 #define HSX_C0_MSR_PMON_BOX_FILTER 0x0E05 // CBo 0 PMON Filter0
656 #define HSX_C0_MSR_PMON_CTL3 0x0E04 // CBo 0 PMON Control for Counter 3
657 #define HSX_C0_MSR_PMON_CTL2 0x0E03 // CBo 0 PMON Control for Counter 2
658 #define HSX_C0_MSR_PMON_CTL1 0x0E02 // CBo 0 PMON Control for Counter 1
659 #define HSX_C0_MSR_PMON_CTL0 0x0E01 // CBo 0 PMON Control for Counter 0
661 #define HSX_C0_MSR_PMON_BOX_STATUS 0x0E07 // CBo 0 PMON Box-Wide Status
662 #define HSX_C0_MSR_PMON_BOX_CTL 0x0E00 // CBo 0 PMON Box-Wide Control
664 #define HSX_CBO_MSR_STEP 0x0010 // CBo MSR Step
666 #define CBO_MSR_PMON_BOX_CTL_RST_CONTROL (1<<0)
667 #define CBO_MSR_PMON_BOX_CTL_RST_COUNTERS (1<<1)
668 #define CBO_MSR_PMON_BOX_CTL_FRZ (1<<8)
669 #define CBO_MSR_PMON_BOX_CTL_FRZ_EN (1<<16)
671 #define CBO_MSR_PMON_CTL_EVENT(x) (x<<0)
672 #define CBO_MSR_PMON_CTL_UMASK(x) (x<<8)
673 #define CBO_MSR_PMON_CTL_RST (1<<17)
674 #define CBO_MSR_PMON_CTL_EDGE_DET (1<<18)
675 #define CBO_MSR_PMON_CTL_TID_EN (1<<19)
676 #define CBO_MSR_PMON_CTL_EN (1<<22)
677 #define CBO_MSR_PMON_CTL_INVERT (1<<23)
678 #define CBO_MSR_PMON_CTL_THRESH(x) (x<<24UL)
680 #define JKT_CBO_MSR_PMON_BOX_FILTER_OPC(x) (x<<23UL)
681 #define IVTHSX_CBO_MSR_PMON_BOX_FILTER1_OPC(x) (x<<20UL)
683 #define MSR_PACKAGE_THERM_STATUS (0x01B1)
684 #define MSR_IA32_THERM_STATUS (0x019C)
685 #define PCM_INVALID_THERMAL_HEADROOM ((std::numeric_limits<int32>::min)())
687 #define MSR_DRAM_ENERGY_STATUS (0x0619)
689 #define MSR_PKG_C2_RESIDENCY (0x60D)
690 #define MSR_PKG_C3_RESIDENCY (0x3F8)
691 #define MSR_PKG_C6_RESIDENCY (0x3F9)
692 #define MSR_PKG_C7_RESIDENCY (0x3FA)
693 #define MSR_CORE_C3_RESIDENCY (0x3FC)
694 #define MSR_CORE_C6_RESIDENCY (0x3FD)
695 #define MSR_CORE_C7_RESIDENCY (0x3FE)
714 unsigned long long baseAddress;
715 unsigned short PCISegmentGroupNumber;
716 unsigned char startBusNumber;
717 unsigned char endBusNumber;
721 std::cout <<
"BaseAddress="<< (std::hex) <<
"0x"<<baseAddress<<
" PCISegmentGroupNumber=0x"<< PCISegmentGroupNumber <<
722 " startBusNumber=0x"<<(
unsigned)startBusNumber<<
" endBusNumber=0x" <<(unsigned)endBusNumber<< std::endl;
730 unsigned char revision;
731 unsigned char checksum;
734 unsigned OEMRevision;
736 unsigned creatorRevision;
739 unsigned nrecords()
const
746 std::cout <<
"Header: length="<<length<<
" nrecords="<< nrecords() << std::endl;