PAPI 7.1.0.0
Loading...
Searching...
No Matches
i386_p6_events.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005-2007 Hewlett-Packard Development Company, L.P.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 *
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:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
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.
21 *
22 * This file is part of libpfm, a performance monitoring support library for
23 * applications on Linux.
24 */
25#define I386_P6_MESI_UMASKS \
26 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO, \
27 .pme_numasks = 4, \
28 .pme_umasks = { \
29 { .pme_uname = "I", \
30 .pme_udesc = "invalid state", \
31 .pme_ucode = 0x1 \
32 }, \
33 { .pme_uname = "S", \
34 .pme_udesc = "shared state", \
35 .pme_ucode = 0x2 \
36 }, \
37 { .pme_uname = "E", \
38 .pme_udesc = "exclusive state", \
39 .pme_ucode = 0x4 \
40 }, \
41 { .pme_uname = "M", \
42 .pme_udesc = "modified state", \
43 .pme_ucode = 0x8 \
44 }}
45
46#define I386_PM_MESI_PREFETCH_UMASKS \
47 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO, \
48 .pme_numasks = 7, \
49 .pme_umasks = { \
50 { .pme_uname = "I", \
51 .pme_udesc = "invalid state", \
52 .pme_ucode = 0x1 \
53 }, \
54 { .pme_uname = "S", \
55 .pme_udesc = "shared state", \
56 .pme_ucode = 0x2 \
57 }, \
58 { .pme_uname = "E", \
59 .pme_udesc = "exclusive state", \
60 .pme_ucode = 0x4 \
61 }, \
62 { .pme_uname = "M", \
63 .pme_udesc = "modified state", \
64 .pme_ucode = 0x8 \
65 }, \
66 { .pme_uname = "EXCL_HW_PREFETCH", \
67 .pme_udesc = "exclude hardware prefetched lines", \
68 .pme_ucode = 0x0 \
69 }, \
70 { .pme_uname = "ONLY_HW_PREFETCH", \
71 .pme_udesc = "only hardware prefetched lines", \
72 .pme_ucode = 0x1 << 4 \
73 }, \
74 { .pme_uname = "NON_HW_PREFETCH", \
75 .pme_udesc = "non hardware prefetched lines", \
76 .pme_ucode = 0x2 << 4 \
77 }}
78
79
80#define I386_P6_PII_ONLY_PME \
81 {.pme_name = "MMX_INSTR_EXEC",\
82 .pme_code = 0xb0,\
83 .pme_desc = "Number of MMX instructions executed"\
84 },\
85 {.pme_name = "MMX_INSTR_RET",\
86 .pme_code = 0xce,\
87 .pme_desc = "Number of MMX instructions retired"\
88 }\
89
90#define I386_P6_PII_PIII_PME \
91 {.pme_name = "MMX_SAT_INSTR_EXEC",\
92 .pme_code = 0xb1,\
93 .pme_desc = "Number of MMX saturating instructions executed"\
94 },\
95 {.pme_name = "MMX_UOPS_EXEC",\
96 .pme_code = 0xb2,\
97 .pme_desc = "Number of MMX micro-ops executed"\
98 },\
99 {.pme_name = "MMX_INSTR_TYPE_EXEC",\
100 .pme_code = 0xb3,\
101 .pme_desc = "Number of MMX instructions executed by type",\
102 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO, \
103 .pme_numasks = 6, \
104 .pme_umasks = { \
105 { .pme_uname = "MUL", \
106 .pme_udesc = "MMX packed multiply instructions executed", \
107 .pme_ucode = 0x1 \
108 }, \
109 { .pme_uname = "SHIFT", \
110 .pme_udesc = "MMX packed shift instructions executed", \
111 .pme_ucode = 0x2 \
112 }, \
113 { .pme_uname = "PACK", \
114 .pme_udesc = "MMX pack operation instructions executed", \
115 .pme_ucode = 0x4 \
116 }, \
117 { .pme_uname = "UNPACK", \
118 .pme_udesc = "MMX unpack operation instructions executed", \
119 .pme_ucode = 0x8 \
120 }, \
121 { .pme_uname = "LOGICAL", \
122 .pme_udesc = "MMX packed logical instructions executed", \
123 .pme_ucode = 0x10 \
124 }, \
125 { .pme_uname = "ARITH", \
126 .pme_udesc = "MMX packed arithmetic instructions executed", \
127 .pme_ucode = 0x20 \
128 } \
129 }\
130 },\
131 {.pme_name = "FP_MMX_TRANS",\
132 .pme_code = 0xcc,\
133 .pme_desc = "Number of MMX transitions",\
134 .pme_numasks = 2, \
135 .pme_umasks = { \
136 { .pme_uname = "TO_FP", \
137 .pme_udesc = "from MMX instructions to floating-point instructions", \
138 .pme_ucode = 0x00 \
139 }, \
140 { .pme_uname = "TO_MMX", \
141 .pme_udesc = "from floating-point instructions to MMX instructions", \
142 .pme_ucode = 0x01 \
143 }\
144 }\
145 },\
146 {.pme_name = "MMX_ASSIST",\
147 .pme_code = 0xcd,\
148 .pme_desc = "Number of MMX micro-ops executed"\
149 },\
150 {.pme_name = "SEG_RENAME_STALLS",\
151 .pme_code = 0xd4,\
152 .pme_desc = "Number of Segment Register Renaming Stalls", \
153 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO, \
154 .pme_numasks = 4, \
155 .pme_umasks = { \
156 { .pme_uname = "ES", \
157 .pme_udesc = "Segment register ES", \
158 .pme_ucode = 0x1 \
159 }, \
160 { .pme_uname = "DS", \
161 .pme_udesc = "Segment register DS", \
162 .pme_ucode = 0x2 \
163 }, \
164 { .pme_uname = "FS", \
165 .pme_udesc = "Segment register FS", \
166 .pme_ucode = 0x4 \
167 }, \
168 { .pme_uname = "GS", \
169 .pme_udesc = "Segment register GS", \
170 .pme_ucode = 0x8 \
171 } \
172 }\
173 },\
174 {.pme_name = "SEG_REG_RENAMES",\
175 .pme_code = 0xd5,\
176 .pme_desc = "Number of Segment Register Renames", \
177 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO, \
178 .pme_numasks = 4, \
179 .pme_umasks = { \
180 { .pme_uname = "ES", \
181 .pme_udesc = "Segment register ES", \
182 .pme_ucode = 0x1 \
183 }, \
184 { .pme_uname = "DS", \
185 .pme_udesc = "Segment register DS", \
186 .pme_ucode = 0x2 \
187 }, \
188 { .pme_uname = "FS", \
189 .pme_udesc = "Segment register FS", \
190 .pme_ucode = 0x4 \
191 }, \
192 { .pme_uname = "GS", \
193 .pme_udesc = "Segment register GS", \
194 .pme_ucode = 0x8 \
195 } \
196 }\
197 },\
198 {.pme_name = "RET_SEG_RENAMES",\
199 .pme_code = 0xd6,\
200 .pme_desc = "Number of segment register rename events retired"\
201 } \
202
203#define I386_P6_PIII_PME \
204 {.pme_name = "EMON_KNI_PREF_DISPATCHED",\
205 .pme_code = 0x07,\
206 .pme_desc = "Number of Streaming SIMD extensions prefetch/weakly-ordered instructions dispatched " \
207 "(speculative prefetches are included in counting). Pentium III and later",\
208 .pme_numasks = 4, \
209 .pme_umasks = { \
210 { .pme_uname = "NTA", \
211 .pme_udesc = "prefetch NTA", \
212 .pme_ucode = 0x00 \
213 }, \
214 { .pme_uname = "T1", \
215 .pme_udesc = "prefetch T1", \
216 .pme_ucode = 0x01 \
217 }, \
218 { .pme_uname = "T2", \
219 .pme_udesc = "prefetch T2", \
220 .pme_ucode = 0x02 \
221 }, \
222 { .pme_uname = "WEAK", \
223 .pme_udesc = "weakly ordered stores", \
224 .pme_ucode = 0x03 \
225 } \
226 } \
227 },\
228 {.pme_name = "EMON_KNI_PREF_MISS",\
229 .pme_code = 0x4b,\
230 .pme_desc = "Number of prefetch/weakly-ordered instructions that miss all caches. Pentium III and later",\
231 .pme_numasks = 4, \
232 .pme_umasks = { \
233 { .pme_uname = "NTA", \
234 .pme_udesc = "prefetch NTA", \
235 .pme_ucode = 0x00 \
236 }, \
237 { .pme_uname = "T1", \
238 .pme_udesc = "prefetch T1", \
239 .pme_ucode = 0x01 \
240 }, \
241 { .pme_uname = "T2", \
242 .pme_udesc = "prefetch T2", \
243 .pme_ucode = 0x02 \
244 }, \
245 { .pme_uname = "WEAK", \
246 .pme_udesc = "weakly ordered stores", \
247 .pme_ucode = 0x03 \
248 } \
249 } \
250 } \
251
252
253#define I386_P6_CPU_CLK_UNHALTED \
254 {.pme_name = "CPU_CLK_UNHALTED",\
255 .pme_code = 0x79,\
256 .pme_desc = "Number cycles during which the processor is not halted"\
257 }\
258
259
260#define I386_P6_NOT_PM_PME \
261 {.pme_name = "L2_LD",\
262 .pme_code = 0x29,\
263 .pme_desc = "Number of L2 data loads. This event indicates that a normal, unlocked, load memory access "\
264 "was received by the L2. It includes only L2 cacheable memory accesses; it does not include I/O "\
265 "accesses, other non-memory accesses, or memory accesses such as UC/WT memory accesses. It does include "\
266 "L2 cacheable TLB miss memory accesses",\
267 I386_P6_MESI_UMASKS\
268 },\
269 {.pme_name = "L2_LINES_IN",\
270 .pme_code = 0x24,\
271 .pme_desc = "Number of lines allocated in the L2"\
272 },\
273 {.pme_name = "L2_LINES_OUT",\
274 .pme_code = 0x26,\
275 .pme_desc = "Number of lines removed from the L2 for any reason"\
276 },\
277 {.pme_name = "L2_M_LINES_OUTM",\
278 .pme_code = 0x27,\
279 .pme_desc = "Number of modified lines removed from the L2 for any reason"\
280 }\
281
282
283#define I386_P6_PIII_NOT_PM_PME \
284 {.pme_name = "EMON_KNI_INST_RETIRED",\
285 .pme_code = 0xd8,\
286 .pme_desc = "Number of SSE instructions retired. Pentium III and later",\
287 .pme_numasks = 2, \
288 .pme_umasks = { \
289 { .pme_uname = "PACKED_SCALAR", \
290 .pme_udesc = "packed and scalar instructions", \
291 .pme_ucode = 0x00 \
292 }, \
293 { .pme_uname = "SCALAR", \
294 .pme_udesc = "scalar only", \
295 .pme_ucode = 0x01 \
296 } \
297 } \
298 },\
299 {.pme_name = "EMON_KNI_COMP_INST_RET",\
300 .pme_code = 0xd9,\
301 .pme_desc = "Number of SSE computation instructions retired. Pentium III and later",\
302 .pme_numasks = 2, \
303 .pme_umasks = { \
304 { .pme_uname = "PACKED_SCALAR", \
305 .pme_udesc = "packed and scalar instructions", \
306 .pme_ucode = 0x00 \
307 }, \
308 { .pme_uname = "SCALAR", \
309 .pme_udesc = "scalar only", \
310 .pme_ucode = 0x01 \
311 } \
312 } \
313 }\
314
315
316
317#define I386_P6_COMMON_PME \
318 {.pme_name = "INST_RETIRED",\
319 .pme_code = 0xc0,\
320 .pme_desc = "Number of instructions retired"\
321 },\
322 {.pme_name = "DATA_MEM_REFS",\
323 .pme_code = 0x43,\
324 .pme_desc = "All loads from any memory type. All stores to any memory type"\
325 "Each part of a split is counted separately. The internal logic counts not only memory loads and stores"\
326 " but also internal retries. 80-bit floating point accesses are double counted, since they are decomposed"\
327 " into a 16-bit exponent load and a 64-bit mantissa load. Memory accesses are only counted when they are "\
328 " actually performed (such as a load that gets squashed because a previous cache miss is outstanding to the"\
329 " same address, and which finally gets performe, is only counted once). Does ot include I/O accesses or other"\
330 " non-memory accesses"\
331 },\
332 {.pme_name = "DCU_LINES_IN",\
333 .pme_code = 0x45,\
334 .pme_desc = "Total lines allocated in the DCU"\
335 },\
336 {.pme_name = "DCU_M_LINES_IN",\
337 .pme_code = 0x46,\
338 .pme_desc = "Number of M state lines allocated in the DCU"\
339 },\
340 {.pme_name = "DCU_M_LINES_OUT",\
341 .pme_code = 0x47,\
342 .pme_desc = "Number of M state lines evicted from the DCU. This includes evictions via snoop HITM, intervention"\
343 " or replacement"\
344 },\
345 {.pme_name = "DCU_MISS_OUTSTANDING",\
346 .pme_code = 0x48,\
347 .pme_desc = "Weighted number of cycle while a DCU miss is outstanding, incremented by the number of cache misses"\
348 " at any particular time. Cacheable read requests only are considered. Uncacheable requests are excluded"\
349 " Read-for-ownerships are counted, as well as line fills, invalidates, and stores"\
350 },\
351 {.pme_name = "IFU_IFETCH",\
352 .pme_code = 0x80,\
353 .pme_desc = "Number of instruction fetches, both cacheable and noncacheable including UC fetches"\
354 },\
355 {.pme_name = "IFU_IFETCH_MISS",\
356 .pme_code = 0x81,\
357 .pme_desc = "Number of instruction fetch misses. All instructions fetches that do not hit the IFU (i.e., that"\
358 " produce memory requests). Includes UC accesses"\
359 },\
360 {.pme_name = "ITLB_MISS",\
361 .pme_code = 0x85,\
362 .pme_desc = "Number of ITLB misses"\
363 },\
364 {.pme_name = "IFU_MEM_STALL",\
365 .pme_code = 0x86,\
366 .pme_desc = "Number of cycles instruction fetch is stalled for any reason. Includs IFU cache misses, ITLB misses,"\
367 " ITLB faults, and other minor stalls"\
368 },\
369 {.pme_name = "ILD_STALL",\
370 .pme_code = 0x87,\
371 .pme_desc = "Number of cycles that the instruction length decoder is stalled"\
372 },\
373 {.pme_name = "L2_IFETCH",\
374 .pme_code = 0x28,\
375 .pme_desc = "Number of L2 instruction fetches. This event indicates that a normal instruction fetch was received by"\
376 " the L2. The count includes only L2 cacheable instruction fetches: it does not include UC instruction fetches"\
377 " It does not include ITLB miss accesses",\
378 I386_P6_MESI_UMASKS \
379 }, \
380 {.pme_name = "L2_ST",\
381 .pme_code = 0x2a,\
382 .pme_desc = "Number of L2 data stores. This event indicates that a normal, unlocked, store memory access "\
383 "was received by the L2. Specifically, it indictes that the DCU sent a read-for ownership request to " \
384 "the L2. It also includes Invalid to Modified reqyests sent by the DCU to the L2. " \
385 "It includes only L2 cacheable memory accesses; it does not include I/O " \
386 "accesses, other non-memory accesses, or memory accesses such as UC/WT memory accesses. It does include " \
387 "L2 cacheable TLB miss memory accesses", \
388 I386_P6_MESI_UMASKS \
389 },\
390 {.pme_name = "L2_M_LINES_INM",\
391 .pme_code = 0x25,\
392 .pme_desc = "Number of modified lines allocated in the L2"\
393 },\
394 {.pme_name = "L2_RQSTS",\
395 .pme_code = 0x2e,\
396 .pme_desc = "Total number of L2 requests",\
397 I386_P6_MESI_UMASKS \
398 },\
399 {.pme_name = "L2_ADS",\
400 .pme_code = 0x21,\
401 .pme_desc = "Number of L2 address strobes"\
402 },\
403 {.pme_name = "L2_DBUS_BUSY",\
404 .pme_code = 0x22,\
405 .pme_desc = "Number of cycles during which the L2 cache data bus was busy"\
406 },\
407 {.pme_name = "L2_DBUS_BUSY_RD",\
408 .pme_code = 0x23,\
409 .pme_desc = "Number of cycles during which the data bus was busy transferring read data from L2 to the processor"\
410 },\
411 {.pme_name = "BUS_DRDY_CLOCKS",\
412 .pme_code = 0x62,\
413 .pme_desc = "Number of clocks during which DRDY# is asserted. " \
414 "Utilization of the external system data bus during data transfers", \
415 .pme_numasks = 2, \
416 .pme_umasks = { \
417 { .pme_uname = "SELF", \
418 .pme_udesc = "clocks when processor is driving bus", \
419 .pme_ucode = 0x00 \
420 }, \
421 { .pme_uname = "ANY", \
422 .pme_udesc = "clocks when any agent is driving bus", \
423 .pme_ucode = 0x20 \
424 } \
425 } \
426 },\
427 {.pme_name = "BUS_LOCK_CLOCKS",\
428 .pme_code = 0x63,\
429 .pme_desc = "Number of clocks during which LOCK# is asserted on the external system bus", \
430 .pme_numasks = 2, \
431 .pme_umasks = { \
432 { .pme_uname = "SELF", \
433 .pme_udesc = "clocks when processor is driving bus", \
434 .pme_ucode = 0x00 \
435 }, \
436 { .pme_uname = "ANY", \
437 .pme_udesc = "clocks when any agent is driving bus", \
438 .pme_ucode = 0x20 \
439 } \
440 } \
441 },\
442 {.pme_name = "BUS_REQ_OUTSTANDING",\
443 .pme_code = 0x60,\
444 .pme_desc = "Number of bus requests outstanding. This counter is incremented " \
445 "by the number of cacheable read bus requests outstanding in any given cycle", \
446 },\
447 {.pme_name = "BUS_TRANS_BRD",\
448 .pme_code = 0x65,\
449 .pme_desc = "Number of burst read transactions", \
450 .pme_numasks = 2, \
451 .pme_umasks = { \
452 { .pme_uname = "SELF", \
453 .pme_udesc = "clocks when processor is driving bus", \
454 .pme_ucode = 0x00 \
455 }, \
456 { .pme_uname = "ANY", \
457 .pme_udesc = "clocks when any agent is driving bus", \
458 .pme_ucode = 0x20 \
459 } \
460 } \
461 },\
462 {.pme_name = "BUS_TRANS_RFO",\
463 .pme_code = 0x66,\
464 .pme_desc = "Number of completed read for ownership transactions",\
465 .pme_numasks = 2, \
466 .pme_umasks = { \
467 { .pme_uname = "SELF", \
468 .pme_udesc = "clocks when processor is driving bus", \
469 .pme_ucode = 0x00 \
470 }, \
471 { .pme_uname = "ANY", \
472 .pme_udesc = "clocks when any agent is driving bus", \
473 .pme_ucode = 0x20 \
474 } \
475 } \
476 },\
477 {.pme_name = "BUS_TRANS_WB",\
478 .pme_code = 0x67,\
479 .pme_desc = "Number of completed write back transactions",\
480 .pme_numasks = 2, \
481 .pme_umasks = { \
482 { .pme_uname = "SELF", \
483 .pme_udesc = "clocks when processor is driving bus", \
484 .pme_ucode = 0x00 \
485 }, \
486 { .pme_uname = "ANY", \
487 .pme_udesc = "clocks when any agent is driving bus", \
488 .pme_ucode = 0x20 \
489 } \
490 } \
491 },\
492 {.pme_name = "BUS_TRAN_IFETCH",\
493 .pme_code = 0x68,\
494 .pme_desc = "Number of completed instruction fetch transactions",\
495 .pme_numasks = 2, \
496 .pme_umasks = { \
497 { .pme_uname = "SELF", \
498 .pme_udesc = "clocks when processor is driving bus", \
499 .pme_ucode = 0x00 \
500 }, \
501 { .pme_uname = "ANY", \
502 .pme_udesc = "clocks when any agent is driving bus", \
503 .pme_ucode = 0x20 \
504 } \
505 } \
506 },\
507 {.pme_name = "BUS_TRAN_INVAL",\
508 .pme_code = 0x69,\
509 .pme_desc = "Number of completed invalidate transactions",\
510 .pme_numasks = 2, \
511 .pme_umasks = { \
512 { .pme_uname = "SELF", \
513 .pme_udesc = "clocks when processor is driving bus", \
514 .pme_ucode = 0x00 \
515 }, \
516 { .pme_uname = "ANY", \
517 .pme_udesc = "clocks when any agent is driving bus", \
518 .pme_ucode = 0x20 \
519 } \
520 } \
521 },\
522 {.pme_name = "BUS_TRAN_PWR",\
523 .pme_code = 0x6a,\
524 .pme_desc = "Number of completed partial write transactions",\
525 .pme_numasks = 2, \
526 .pme_umasks = { \
527 { .pme_uname = "SELF", \
528 .pme_udesc = "clocks when processor is driving bus", \
529 .pme_ucode = 0x00 \
530 }, \
531 { .pme_uname = "ANY", \
532 .pme_udesc = "clocks when any agent is driving bus", \
533 .pme_ucode = 0x20 \
534 } \
535 } \
536 },\
537 {.pme_name = "BUS_TRANS_P",\
538 .pme_code = 0x6b,\
539 .pme_desc = "Number of completed partial transactions",\
540 .pme_numasks = 2, \
541 .pme_umasks = { \
542 { .pme_uname = "SELF", \
543 .pme_udesc = "clocks when processor is driving bus", \
544 .pme_ucode = 0x00 \
545 }, \
546 { .pme_uname = "ANY", \
547 .pme_udesc = "clocks when any agent is driving bus", \
548 .pme_ucode = 0x20 \
549 } \
550 } \
551 },\
552 {.pme_name = "BUS_TRANS_IO",\
553 .pme_code = 0x6c,\
554 .pme_desc = "Number of completed I/O transactions",\
555 .pme_numasks = 2, \
556 .pme_umasks = { \
557 { .pme_uname = "SELF", \
558 .pme_udesc = "clocks when processor is driving bus", \
559 .pme_ucode = 0x00 \
560 }, \
561 { .pme_uname = "ANY", \
562 .pme_udesc = "clocks when any agent is driving bus", \
563 .pme_ucode = 0x20 \
564 } \
565 } \
566 },\
567 {.pme_name = "BUS_TRAN_DEF",\
568 .pme_code = 0x6d,\
569 .pme_desc = "Number of completed deferred transactions",\
570 .pme_numasks = 2, \
571 .pme_umasks = { \
572 { .pme_uname = "SELF", \
573 .pme_udesc = "clocks when processor is driving bus", \
574 .pme_ucode = 0x1 \
575 }, \
576 { .pme_uname = "ANY", \
577 .pme_udesc = "clocks when any agent is driving bus", \
578 .pme_ucode = 0x2 \
579 } \
580 } \
581 },\
582 {.pme_name = "BUS_TRAN_BURST",\
583 .pme_code = 0x6e,\
584 .pme_desc = "Number of completed burst transactions",\
585 .pme_numasks = 2, \
586 .pme_umasks = { \
587 { .pme_uname = "SELF", \
588 .pme_udesc = "clocks when processor is driving bus", \
589 .pme_ucode = 0x00 \
590 }, \
591 { .pme_uname = "ANY", \
592 .pme_udesc = "clocks when any agent is driving bus", \
593 .pme_ucode = 0x20 \
594 } \
595 } \
596 },\
597 {.pme_name = "BUS_TRAN_ANY",\
598 .pme_code = 0x70,\
599 .pme_desc = "Number of all completed bus transactions. Address bus utilization " \
600 "can be calculated knowing the minimum address bus occupancy. Includes special cycles, etc.",\
601 .pme_numasks = 2, \
602 .pme_umasks = { \
603 { .pme_uname = "SELF", \
604 .pme_udesc = "clocks when processor is driving bus", \
605 .pme_ucode = 0x00 \
606 }, \
607 { .pme_uname = "ANY", \
608 .pme_udesc = "clocks when any agent is driving bus", \
609 .pme_ucode = 0x20 \
610 } \
611 } \
612 },\
613 {.pme_name = "BUS_TRAN_MEM",\
614 .pme_code = 0x6f,\
615 .pme_desc = "Number of completed memory transactions",\
616 .pme_numasks = 2, \
617 .pme_umasks = { \
618 { .pme_uname = "SELF", \
619 .pme_udesc = "clocks when processor is driving bus", \
620 .pme_ucode = 0x00 \
621 }, \
622 { .pme_uname = "ANY", \
623 .pme_udesc = "clocks when any agent is driving bus", \
624 .pme_ucode = 0x20 \
625 } \
626 } \
627 },\
628 {.pme_name = "BUS_DATA_RECV",\
629 .pme_code = 0x64,\
630 .pme_desc = "Number of bus clock cycles during which this processor is receiving data"\
631 },\
632 {.pme_name = "BUS_BNR_DRV",\
633 .pme_code = 0x61,\
634 .pme_desc = "Number of bus clock cycles during which this processor is driving the BNR# pin"\
635 },\
636 {.pme_name = "BUS_HIT_DRV",\
637 .pme_code = 0x7a,\
638 .pme_desc = "Number of bus clock cycles during which this processor is driving the HIT# pin"\
639 },\
640 {.pme_name = "BUS_HITM_DRV",\
641 .pme_code = 0x7b,\
642 .pme_desc = "Number of bus clock cycles during which this processor is driving the HITM# pin"\
643 },\
644 {.pme_name = "BUS_SNOOP_STALL",\
645 .pme_code = 0x7e,\
646 .pme_desc = "Number of clock cycles during which the bus is snoop stalled"\
647 },\
648 {.pme_name = "FLOPS",\
649 .pme_code = 0xc1,\
650 .pme_desc = "Number of computational floating-point operations retired. " \
651 "Excludes floating-point computational operations that cause traps or assists. " \
652 "Includes internal sub-operations for complex floating-point instructions like transcendentals. " \
653 "Excludes floating point loads and stores", \
654 .pme_flags = PFMLIB_I386_P6_CTR0_ONLY \
655 },\
656 {.pme_name = "FP_COMP_OPS_EXE",\
657 .pme_code = 0x10,\
658 .pme_desc = "Number of computational floating-point operations executed. The number of FADD, FSUB, " \
659 "FCOM, FMULs, integer MULs and IMULs, FDIVs, FPREMs, FSQRTS, integer DIVs, and IDIVs. " \
660 "This number does not include the number of cycles, but the number of operations. " \
661 "This event does not distinguish an FADD used in the middle of a transcendental flow " \
662 "from a separate FADD instruction", \
663 .pme_flags = PFMLIB_I386_P6_CTR0_ONLY \
664 },\
665 {.pme_name = "FP_ASSIST",\
666 .pme_code = 0x11,\
667 .pme_desc = "Number of floating-point exception cases handled by microcode.", \
668 .pme_flags = PFMLIB_I386_P6_CTR1_ONLY \
669 },\
670 {.pme_name = "MUL",\
671 .pme_code = 0x12,\
672 .pme_desc = "Number of multiplies." \
673 "This count includes integer as well as FP multiplies and is speculative", \
674 .pme_flags = PFMLIB_I386_P6_CTR1_ONLY \
675 },\
676 {.pme_name = "DIV",\
677 .pme_code = 0x13,\
678 .pme_desc = "Number of divides." \
679 "This count includes integer as well as FP divides and is speculative", \
680 .pme_flags = PFMLIB_I386_P6_CTR1_ONLY \
681 },\
682 {.pme_name = "CYCLES_DIV_BUSY",\
683 .pme_code = 0x14,\
684 .pme_desc = "Number of cycles during which the divider is busy, and cannot accept new divides. " \
685 "This includes integer and FP divides, FPREM, FPSQRT, etc. and is speculative", \
686 .pme_flags = PFMLIB_I386_P6_CTR0_ONLY \
687 },\
688 {.pme_name = "LD_BLOCKS",\
689 .pme_code = 0x03,\
690 .pme_desc = "Number of load operations delayed due to store buffer blocks. Includes counts " \
691 "caused by preceding stores whose addresses are unknown, preceding stores whose addresses " \
692 "are known but whose data is unknown, and preceding stores that conflicts with the load " \
693 "but which incompletely overlap the load" \
694 },\
695 {.pme_name = "SB_DRAINS",\
696 .pme_code = 0x04,\
697 .pme_desc = "Number of store buffer drain cycles. Incremented every cycle the store buffer is draining. " \
698 "Draining is caused by serializing operations like CPUID, synchronizing operations " \
699 "like XCHG, interrupt acknowledgment, as well as other conditions (such as cache flushing)."\
700 },\
701 {.pme_name = "MISALIGN_MEM_REF",\
702 .pme_code = 0x05,\
703 .pme_desc = "Number of misaligned data memory references. Incremented by 1 every cycle during "\
704 "which, either the processor's load or store pipeline dispatches a misaligned micro-op "\
705 "Counting is performed if it is the first or second half or if it is blocked, squashed, "\
706 "or missed. In this context, misaligned means crossing a 64-bit boundary"\
707 },\
708 {.pme_name = "UOPS_RETIRED",\
709 .pme_code = 0xc2,\
710 .pme_desc = "Number of micro-ops retired"\
711 },\
712 {.pme_name = "INST_DECODED",\
713 .pme_code = 0xd0,\
714 .pme_desc = "Number of instructions decoded"\
715 },\
716 {.pme_name = "HW_INT_RX",\
717 .pme_code = 0xc8,\
718 .pme_desc = "Number of hardware interrupts received"\
719 },\
720 {.pme_name = "CYCLES_INT_MASKED",\
721 .pme_code = 0xc6,\
722 .pme_desc = "Number of processor cycles for which interrupts are disabled"\
723 },\
724 {.pme_name = "CYCLES_INT_PENDING_AND_MASKED",\
725 .pme_code = 0xc7,\
726 .pme_desc = "Number of processor cycles for which interrupts are disabled and interrupts are pending."\
727 },\
728 {.pme_name = "BR_INST_RETIRED",\
729 .pme_code = 0xc4,\
730 .pme_desc = "Number of branch instructions retired"\
731 },\
732 {.pme_name = "BR_MISS_PRED_RETIRED",\
733 .pme_code = 0xc5,\
734 .pme_desc = "Number of mispredicted branches retired"\
735 },\
736 {.pme_name = "BR_TAKEN_RETIRED",\
737 .pme_code = 0xc9,\
738 .pme_desc = "Number of taken branches retired"\
739 },\
740 {.pme_name = "BR_MISS_PRED_TAKEN_RET",\
741 .pme_code = 0xca,\
742 .pme_desc = "Number of taken mispredicted branches retired"\
743 },\
744 {.pme_name = "BR_INST_DECODED",\
745 .pme_code = 0xe0,\
746 .pme_desc = "Number of branch instructions decoded"\
747 },\
748 {.pme_name = "BTB_MISSES",\
749 .pme_code = 0xe2,\
750 .pme_desc = "Number of branches for which the BTB did not produce a prediction"\
751 },\
752 {.pme_name = "BR_BOGUS",\
753 .pme_code = 0xe4,\
754 .pme_desc = "Number of bogus branches"\
755 },\
756 {.pme_name = "BACLEARS",\
757 .pme_code = 0xe6,\
758 .pme_desc = "Number of times BACLEAR is asserted. This is the number of times that " \
759 "a static branch prediction was made, in which the branch decoder decided " \
760 "to make a branch prediction because the BTB did not" \
761 },\
762 {.pme_name = "RESOURCE_STALLS",\
763 .pme_code = 0xa2,\
764 .pme_desc = "Incremented by 1 during every cycle for which there is a resource related stall. " \
765 "Includes register renaming buffer entries, memory buffer entries. Does not include " \
766 "stalls due to bus queue full, too many cache misses, etc. In addition to resource " \
767 "related stalls, this event counts some other events. Includes stalls arising during " \
768 "branch misprediction recovery, such as if retirement of the mispredicted branch is " \
769 "delayed and stalls arising while store buffer is draining from synchronizing operations" \
770 },\
771 {.pme_name = "PARTIAL_RAT_STALLS",\
772 .pme_code = 0xd2,\
773 .pme_desc = "Number of cycles or events for partial stalls. This includes flag partial stalls"\
774 },\
775 {.pme_name = "SEGMENT_REG_LOADS",\
776 .pme_code = 0x06,\
777 .pme_desc = "Number of segment register loads."\
778 }\
779
780
781
782/*
783 * Pentium Pro Processor Event Table
784 */
786 I386_P6_CPU_CLK_UNHALTED, /* should be first */
787 I386_P6_COMMON_PME, /* generic p6 */
788 I386_P6_NOT_PM_PME, /* generic p6 that conflict with Pentium M */
789};
790
791#define PME_I386_PPRO_CPU_CLK_UNHALTED 0
792#define PME_I386_PPRO_INST_RETIRED 1
793#define PME_I386_PPRO_EVENT_COUNT (sizeof(i386_ppro_pe)/sizeof(pme_i386_p6_entry_t))
794
795
796/*
797 * Pentium II Processor Event Table
798 */
800 I386_P6_CPU_CLK_UNHALTED, /* should be first */
801 I386_P6_COMMON_PME, /* generic p6 */
802 I386_P6_PII_ONLY_PME, /* pentium II only */
803 I386_P6_PII_PIII_PME, /* pentium II and later */
804 I386_P6_NOT_PM_PME, /* generic p6 that conflict with Pentium M */
805};
806
807#define PME_I386_PII_CPU_CLK_UNHALTED 0
808#define PME_I386_PII_INST_RETIRED 1
809#define PME_I386_PII_EVENT_COUNT (sizeof(i386_pII_pe)/sizeof(pme_i386_p6_entry_t))
810
811
812/*
813 * Pentium III Processor Event Table
814 */
816 I386_P6_CPU_CLK_UNHALTED, /* should be first */
817 I386_P6_COMMON_PME, /* generic p6 */
818 I386_P6_PII_PIII_PME, /* pentium II and later */
819 I386_P6_PIII_PME, /* pentium III and later */
820 I386_P6_NOT_PM_PME, /* generic p6 that conflict with Pentium M */
821 I386_P6_PIII_NOT_PM_PME /* pentium III that conflict with Pentium M */
822};
823
824#define PME_I386_PIII_CPU_CLK_UNHALTED 0
825#define PME_I386_PIII_INST_RETIRED 1
826#define PME_I386_PIII_EVENT_COUNT (sizeof(i386_pIII_pe)/sizeof(pme_i386_p6_entry_t))
827
828
829/*
830 * Pentium M event table
831 * It is different from regular P6 because it supports additional events
832 * and also because the semantics of some events is slightly different
833 *
834 * The library autodetects which table to use during pfmlib_initialize()
835 */
837 {.pme_name = "CPU_CLK_UNHALTED",
838 .pme_code = 0x79,
839 .pme_desc = "Number cycles during which the processor is not halted and not in a thermal trip"
840 },
841
842 I386_P6_COMMON_PME, /* generic p6 */
843 I386_P6_PII_PIII_PME, /* pentium II and later */
844 I386_P6_PIII_PME, /* pentium III and later */
845
846 {.pme_name = "EMON_EST_TRANS",
847 .pme_code = 0x58,
848 .pme_desc = "Number of Enhanced Intel SpeedStep technology transitions",
849 .pme_numasks = 2,
850 .pme_umasks = {
851 { .pme_uname = "ALL",
852 .pme_udesc = "All transitions",
853 .pme_ucode = 0x0
854 },
855 { .pme_uname = "FREQ",
856 .pme_udesc = "Only frequency transitions",
857 .pme_ucode = 0x2
858 },
859 }
860 },
861 {.pme_name = "EMON_THERMAL_TRIP",
862 .pme_code = 0x59,
863 .pme_desc = "Duration/occurrences in thermal trip; to count the number of thermal trips; edge detect must be used"
864 },
865 {.pme_name = "BR_INST_EXEC",
866 .pme_code = 0x088,
867 .pme_desc = "Branch instructions executed (not necessarily retired)"
868 },
869 {.pme_name = "BR_MISSP_EXEC",
870 .pme_code = 0x89,
871 .pme_desc = "Branch instructions executed that were mispredicted at execution"
872 },
873 {.pme_name = "BR_BAC_MISSP_EXEC",
874 .pme_code = 0x8a,
875 .pme_desc = "Branch instructions executed that were mispredicted at Front End (BAC)"
876 },
877 {.pme_name = "BR_CND_EXEC",
878 .pme_code = 0x8b,
879 .pme_desc = "Conditional branch instructions executed"
880 },
881 {.pme_name = "BR_CND_MISSP_EXEC",
882 .pme_code = 0x8c,
883 .pme_desc = "Conditional branch instructions executed that were mispredicted"
884 },
885 {.pme_name = "BR_IND_EXEC",
886 .pme_code = 0x8d,
887 .pme_desc = "Indirect branch instructions executed"
888 },
889 {.pme_name = "BR_IND_MISSP_EXEC",
890 .pme_code = 0x8e,
891 .pme_desc = "Indirect branch instructions executed that were mispredicted"
892 },
893 {.pme_name = "BR_RET_EXEC",
894 .pme_code = 0x8f,
895 .pme_desc = "Return branch instructions executed"
896 },
897 {.pme_name = "BR_RET_MISSP_EXEC",
898 .pme_code = 0x90,
899 .pme_desc = "Return branch instructions executed that were mispredicted at Execution"
900 },
901 {.pme_name = "BR_RET_BAC_MISSP_EXEC",
902 .pme_code = 0x91,
903 .pme_desc = "Return branch instructions executed that were mispredicted at Front End (BAC)"
904 },
905 {.pme_name = "BR_CALL_EXEC",
906 .pme_code = 0x92,
907 .pme_desc = "CALL instructions executed"
908 },
909 {.pme_name = "BR_CALL_MISSP_EXEC",
910 .pme_code = 0x93,
911 .pme_desc = "CALL instructions executed that were mispredicted"
912 },
913 {.pme_name = "BR_IND_CALL_EXEC",
914 .pme_code = 0x94,
915 .pme_desc = "Indirect CALL instructions executed"
916 },
917 {.pme_name = "EMON_SIMD_INSTR_RETIRED",
918 .pme_code = 0xce,
919 .pme_desc = "Number of retired MMX instructions"
920 },
921 {.pme_name = "EMON_SYNCH_UOPS",
922 .pme_code = 0xd3,
923 .pme_desc = "Sync micro-ops"
924 },
925 {.pme_name = "EMON_ESP_UOPS",
926 .pme_code = 0xd7,
927 .pme_desc = "Total number of micro-ops"
928 },
929 {.pme_name = "EMON_FUSED_UOPS_RET",
930 .pme_code = 0xda,
931 .pme_desc = "Total number of micro-ops",
932 .pme_flags = PFMLIB_I386_P6_UMASK_COMBO,
933 .pme_numasks = 3,
934 .pme_umasks = {
935 { .pme_uname = "ALL",
936 .pme_udesc = "All fused micro-ops",
937 .pme_ucode = 0x0
938 },
939 { .pme_uname = "LD_OP",
940 .pme_udesc = "Only load+Op micro-ops",
941 .pme_ucode = 0x1
942 },
943 { .pme_uname = "STD_STA",
944 .pme_udesc = "Only std+sta micro-ops",
945 .pme_ucode = 0x2
946 }
947 }
948 },
949 {.pme_name = "EMON_UNFUSION",
950 .pme_code = 0xdb,
951 .pme_desc = "Number of unfusion events in the ROB, happened on a FP exception to a fused micro-op"
952 },
953 {.pme_name = "EMON_PREF_RQSTS_UP",
954 .pme_code = 0xf0,
955 .pme_desc = "Number of upward prefetches issued"
956 },
957 {.pme_name = "EMON_PREF_RQSTS_DN",
958 .pme_code = 0xf8,
959 .pme_desc = "Number of downward prefetches issued"
960 },
961 {.pme_name = "EMON_SSE_SSE2_INST_RETIRED",
962 .pme_code = 0xd8,
963 .pme_desc = "Streaming SIMD extensions instructions retired",
964 .pme_numasks = 4,
965 .pme_umasks = {
966 { .pme_uname = "SSE_PACKED_SCALAR_SINGLE",
967 .pme_udesc = "SSE Packed Single and Scalar Single",
968 .pme_ucode = 0x0
969 },
970 { .pme_uname = "SSE_SCALAR_SINGLE",
971 .pme_udesc = "SSE Scalar Single",
972 .pme_ucode = 0x1
973 },
974 { .pme_uname = "SSE2_PACKED_DOUBLE",
975 .pme_udesc = "SSE2 Packed Double",
976 .pme_ucode = 0x2
977 },
978 { .pme_uname = "SSE2_SCALAR_DOUBLE",
979 .pme_udesc = "SSE2 Scalar Double",
980 .pme_ucode = 0x3
981 }
982 }
983 },
984 {.pme_name = "EMON_SSE_SSE2_COMP_INST_RETIRED",
985 .pme_code = 0xd9,
986 .pme_desc = "Computational SSE instructions retired",
987 .pme_numasks = 4,
988 .pme_umasks = {
989 { .pme_uname = "SSE_PACKED_SINGLE",
990 .pme_udesc = "SSE Packed Single",
991 .pme_ucode = 0x0
992 },
993 { .pme_uname = "SSE_SCALAR_SINGLE",
994 .pme_udesc = "SSE Scalar Single",
995 .pme_ucode = 0x1
996 },
997 { .pme_uname = "SSE2_PACKED_DOUBLE",
998 .pme_udesc = "SSE2 Packed Double",
999 .pme_ucode = 0x2
1000 },
1001 { .pme_uname = "SSE2_SCALAR_DOUBLE",
1002 .pme_udesc = "SSE2 Scalar Double",
1003 .pme_ucode = 0x3
1004 }
1005 }
1006 },
1007 {.pme_name = "L2_LD",
1008 .pme_code = 0x29,
1009 .pme_desc = "Number of L2 data loads",
1011 },
1012 {.pme_name = "L2_LINES_IN",
1013 .pme_code = 0x24,
1014 .pme_desc = "Number of L2 lines allocated",
1016 },
1017 {.pme_name = "L2_LINES_OUT",
1018 .pme_code = 0x26,
1019 .pme_desc = "Number of L2 lines evicted",
1021 },
1022 {.pme_name = "L2_M_LINES_OUT",
1023 .pme_code = 0x27,
1024 .pme_desc = "Number of L2 M-state lines evicted",
1026 }
1027};
1028#define PME_I386_PM_CPU_CLK_UNHALTED 0
1029#define PME_I386_PM_INST_RETIRED 1
1030#define PME_I386_PM_EVENT_COUNT (sizeof(i386_pm_pe)/sizeof(pme_i386_p6_entry_t))
static pme_i386_p6_entry_t i386_ppro_pe[]
#define I386_P6_PIII_NOT_PM_PME
#define I386_P6_NOT_PM_PME
#define I386_P6_PII_ONLY_PME
static pme_i386_p6_entry_t i386_pII_pe[]
static pme_i386_p6_entry_t i386_pIII_pe[]
#define I386_P6_CPU_CLK_UNHALTED
#define I386_PM_MESI_PREFETCH_UMASKS
#define I386_P6_COMMON_PME
#define I386_P6_PIII_PME
static pme_i386_p6_entry_t i386_pm_pe[]
#define I386_P6_PII_PIII_PME
#define PFMLIB_I386_P6_UMASK_COMBO
char * pme_name