2 * Copyright (c) 2012 Google, Inc
3 * Contributed by Stephane Eranian <eranian@gmail.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * This file is part of libpfm, a performance monitoring support library for
23 * applications on Linux.
25 * PMU: snbep_unc_pcu (Intel SandyBridge-EP PCU uncore)
28 static const intel_x86_umask_t snbep_unc_p_power_state_occupancy[]={
29 { .uname = "CORES_C0",
30 .udesc = "Counts number of cores in C0",
32 .uflags = INTEL_X86_NCOMBO,
34 { .uname = "CORES_C3",
35 .udesc = "Counts number of cores in C3",
37 .uflags = INTEL_X86_NCOMBO,
39 { .uname = "CORES_C6",
40 .udesc = "Counts number of cores in C6",
42 .uflags = INTEL_X86_NCOMBO,
46 static const intel_x86_umask_t snbep_unc_p_occupancy_counters[]={
48 .udesc = "Counts number of cores in C0",
50 .uflags = INTEL_X86_NCOMBO,
53 .udesc = "Counts number of cores in C3",
55 .uflags = INTEL_X86_NCOMBO,
58 .udesc = "Counts number of cores in C6",
60 .uflags = INTEL_X86_NCOMBO,
64 static const intel_x86_entry_t intel_snbep_unc_p_pe[]={
65 { .name = "UNC_P_CLOCKTICKS",
66 .desc = "PCU Uncore clockticks",
67 .modmsk = SNBEP_UNC_PCU_ATTRS,
71 { .name = "UNC_P_CORE0_TRANSITION_CYCLES",
72 .desc = "Core C State Transition Cycles",
73 .code = 0x3 | (1ULL << 21), /* sel_ext */
75 .modmsk = SNBEP_UNC_PCU_ATTRS,
77 { .name = "UNC_P_CORE1_TRANSITION_CYCLES",
78 .desc = "Core C State Transition Cycles",
79 .code = 0x4 | (1ULL << 21), /* sel_ext */
81 .modmsk = SNBEP_UNC_PCU_ATTRS,
83 { .name = "UNC_P_CORE2_TRANSITION_CYCLES",
84 .desc = "Core C State Transition Cycles",
85 .code = 0x5 | (1ULL << 21), /* sel_ext */
87 .modmsk = SNBEP_UNC_PCU_ATTRS,
89 { .name = "UNC_P_CORE3_TRANSITION_CYCLES",
90 .desc = "Core C State Transition Cycles",
91 .code = 0x6 | (1ULL << 21), /* sel_ext */
93 .modmsk = SNBEP_UNC_PCU_ATTRS,
95 { .name = "UNC_P_CORE4_TRANSITION_CYCLES",
96 .desc = "Core C State Transition Cycles",
97 .code = 0x7 | (1ULL << 21), /* sel_ext */
99 .modmsk = SNBEP_UNC_PCU_ATTRS,
101 { .name = "UNC_P_CORE5_TRANSITION_CYCLES",
102 .desc = "Core C State Transition Cycles",
103 .code = 0x8 | (1ULL << 21), /* sel_ext */
105 .modmsk = SNBEP_UNC_PCU_ATTRS,
107 { .name = "UNC_P_CORE6_TRANSITION_CYCLES",
108 .desc = "Core C State Transition Cycles",
109 .code = 0x9 | (1ULL << 21), /* sel_ext */
111 .modmsk = SNBEP_UNC_PCU_ATTRS,
113 { .name = "UNC_P_CORE7_TRANSITION_CYCLES",
114 .desc = "Core C State Transition Cycles",
115 .code = 0xa | (1ULL << 21), /* sel_ext */
117 .modmsk = SNBEP_UNC_PCU_ATTRS,
119 { .name = "UNC_P_DEMOTIONS_CORE0",
120 .desc = "Core C State Demotions",
123 .modmsk = SNBEP_UNC_PCU_ATTRS,
125 { .name = "UNC_P_DEMOTIONS_CORE1",
126 .desc = "Core C State Demotions",
129 .modmsk = SNBEP_UNC_PCU_ATTRS,
131 { .name = "UNC_P_DEMOTIONS_CORE2",
132 .desc = "Core C State Demotions",
135 .modmsk = SNBEP_UNC_PCU_ATTRS,
137 { .name = "UNC_P_DEMOTIONS_CORE3",
138 .desc = "Core C State Demotions",
141 .modmsk = SNBEP_UNC_PCU_ATTRS,
143 { .name = "UNC_P_DEMOTIONS_CORE4",
144 .desc = "Core C State Demotions",
147 .modmsk = SNBEP_UNC_PCU_ATTRS,
149 { .name = "UNC_P_DEMOTIONS_CORE5",
150 .desc = "Core C State Demotions",
153 .modmsk = SNBEP_UNC_PCU_ATTRS,
155 { .name = "UNC_P_DEMOTIONS_CORE6",
156 .desc = "Core C State Demotions",
159 .modmsk = SNBEP_UNC_PCU_ATTRS,
161 { .name = "UNC_P_DEMOTIONS_CORE7",
162 .desc = "Core C State Demotions",
165 .modmsk = SNBEP_UNC_PCU_ATTRS,
167 { .name = "UNC_P_FREQ_BAND0_CYCLES",
168 .desc = "Frequency Residency",
171 .flags = INTEL_X86_NO_AUTOENCODE,
172 .modmsk = SNBEP_UNC_PCU_BAND_ATTRS,
173 .modmsk_req = _SNBEP_UNC_ATTR_FF,
175 { .name = "UNC_P_FREQ_BAND1_CYCLES",
176 .desc = "Frequency Residency",
179 .flags = INTEL_X86_NO_AUTOENCODE,
180 .modmsk = SNBEP_UNC_PCU_BAND_ATTRS,
181 .modmsk_req = _SNBEP_UNC_ATTR_FF,
183 { .name = "UNC_P_FREQ_BAND2_CYCLES",
184 .desc = "Frequency Residency",
187 .flags = INTEL_X86_NO_AUTOENCODE,
188 .modmsk = SNBEP_UNC_PCU_BAND_ATTRS,
189 .modmsk_req = _SNBEP_UNC_ATTR_FF,
191 { .name = "UNC_P_FREQ_BAND3_CYCLES",
192 .desc = "Frequency Residency",
195 .flags = INTEL_X86_NO_AUTOENCODE,
196 .modmsk = SNBEP_UNC_PCU_BAND_ATTRS,
197 .modmsk_req = _SNBEP_UNC_ATTR_FF,
199 { .name = "UNC_P_FREQ_MAX_CURRENT_CYCLES",
200 .desc = "Current Strongest Upper Limit Cycles",
203 .modmsk = SNBEP_UNC_PCU_ATTRS,
205 { .name = "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
206 .desc = "Thermal Strongest Upper Limit Cycles",
209 .modmsk = SNBEP_UNC_PCU_ATTRS,
211 { .name = "UNC_P_FREQ_MAX_OS_CYCLES",
212 .desc = "OS Strongest Upper Limit Cycles",
215 .modmsk = SNBEP_UNC_PCU_ATTRS,
217 { .name = "UNC_P_FREQ_MAX_POWER_CYCLES",
218 .desc = "Power Strongest Upper Limit Cycles",
221 .modmsk = SNBEP_UNC_PCU_ATTRS,
223 { .name = "UNC_P_FREQ_MIN_IO_P_CYCLES",
224 .desc = "IO P Limit Strongest Lower Limit Cycles",
225 .code = 0x1 | (1ULL << 21), /* sel_ext */
228 .modmsk = SNBEP_UNC_PCU_ATTRS,
229 .numasks = LIBPFM_ARRAY_SIZE(snbep_unc_p_occupancy_counters),
230 .umasks = snbep_unc_p_occupancy_counters
232 { .name = "UNC_P_FREQ_MIN_PERF_P_CYCLES",
233 .desc = "Perf P Limit Strongest Lower Limit Cycles",
234 .code = 0x2 | (1ULL << 21), /* sel_ext */
237 .modmsk = SNBEP_UNC_PCU_ATTRS,
238 .numasks = LIBPFM_ARRAY_SIZE(snbep_unc_p_occupancy_counters),
239 .umasks = snbep_unc_p_occupancy_counters
241 { .name = "UNC_P_FREQ_TRANS_CYCLES",
242 .desc = "Cycles spent changing Frequency",
243 .code = 0x0 | (1ULL << 21), /* sel_ext */
246 .modmsk = SNBEP_UNC_PCU_ATTRS,
247 .numasks = LIBPFM_ARRAY_SIZE(snbep_unc_p_occupancy_counters),
248 .umasks = snbep_unc_p_occupancy_counters
250 { .name = "UNC_P_MEMORY_PHASE_SHEDDING_CYCLES",
251 .desc = "Memory Phase Shedding Cycles",
254 .modmsk = SNBEP_UNC_PCU_ATTRS,
256 { .name = "UNC_P_POWER_STATE_OCCUPANCY",
257 .desc = "Number of cores in C0",
261 .modmsk = SNBEP_UNC_PCU_ATTRS,
262 .numasks = LIBPFM_ARRAY_SIZE(snbep_unc_p_power_state_occupancy),
263 .umasks = snbep_unc_p_power_state_occupancy
265 { .name = "UNC_P_PROCHOT_EXTERNAL_CYCLES",
266 .desc = "External Prochot",
269 .modmsk = SNBEP_UNC_PCU_ATTRS,
271 { .name = "UNC_P_PROCHOT_INTERNAL_CYCLES",
272 .desc = "Internal Prochot",
275 .modmsk = SNBEP_UNC_PCU_ATTRS,
277 { .name = "UNC_P_TOTAL_TRANSITION_CYCLES",
278 .desc = "Total Core C State Transition Cycles",
279 .code = 0xb | (1ULL << 21), /* sel_ext */
281 .modmsk = SNBEP_UNC_PCU_ATTRS,
283 { .name = "UNC_P_VOLT_TRANS_CYCLES_CHANGE",
284 .desc = "Cycles Changing Voltage",
287 .modmsk = SNBEP_UNC_PCU_ATTRS,
289 { .name = "UNC_P_VOLT_TRANS_CYCLES_DECREASE",
290 .desc = "Cycles Decreasing Voltage",
293 .modmsk = SNBEP_UNC_PCU_ATTRS,
295 { .name = "UNC_P_VOLT_TRANS_CYCLES_INCREASE",
296 .desc = "Cycles Increasing Voltage",
299 .modmsk = SNBEP_UNC_PCU_ATTRS,
301 { .name = "UNC_P_VR_HOT_CYCLES",
305 .modmsk = SNBEP_UNC_PCU_ATTRS,