diff options
Diffstat (limited to 'arch/powerpc/perf/power7-pmu.c')
-rw-r--r-- | arch/powerpc/perf/power7-pmu.c | 148 |
1 files changed, 32 insertions, 116 deletions
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c index d1821b8bbc4c..56c67bca2f75 100644 --- a/arch/powerpc/perf/power7-pmu.c +++ b/arch/powerpc/perf/power7-pmu.c | |||
@@ -53,37 +53,13 @@ | |||
53 | /* | 53 | /* |
54 | * Power7 event codes. | 54 | * Power7 event codes. |
55 | */ | 55 | */ |
56 | #define PME_PM_CYC 0x1e | 56 | #define EVENT(_name, _code) \ |
57 | #define PME_PM_GCT_NOSLOT_CYC 0x100f8 | 57 | PME_##_name = _code, |
58 | #define PME_PM_CMPLU_STALL 0x4000a | 58 | |
59 | #define PME_PM_INST_CMPL 0x2 | 59 | enum { |
60 | #define PME_PM_LD_REF_L1 0xc880 | 60 | #include "power7-events-list.h" |
61 | #define PME_PM_LD_MISS_L1 0x400f0 | 61 | }; |
62 | #define PME_PM_BRU_FIN 0x10068 | 62 | #undef EVENT |
63 | #define PME_PM_BR_MPRED 0x400f6 | ||
64 | |||
65 | #define PME_PM_CMPLU_STALL_FXU 0x20014 | ||
66 | #define PME_PM_CMPLU_STALL_DIV 0x40014 | ||
67 | #define PME_PM_CMPLU_STALL_SCALAR 0x40012 | ||
68 | #define PME_PM_CMPLU_STALL_SCALAR_LONG 0x20018 | ||
69 | #define PME_PM_CMPLU_STALL_VECTOR 0x2001c | ||
70 | #define PME_PM_CMPLU_STALL_VECTOR_LONG 0x4004a | ||
71 | #define PME_PM_CMPLU_STALL_LSU 0x20012 | ||
72 | #define PME_PM_CMPLU_STALL_REJECT 0x40016 | ||
73 | #define PME_PM_CMPLU_STALL_ERAT_MISS 0x40018 | ||
74 | #define PME_PM_CMPLU_STALL_DCACHE_MISS 0x20016 | ||
75 | #define PME_PM_CMPLU_STALL_STORE 0x2004a | ||
76 | #define PME_PM_CMPLU_STALL_THRD 0x1001c | ||
77 | #define PME_PM_CMPLU_STALL_IFU 0x4004c | ||
78 | #define PME_PM_CMPLU_STALL_BRU 0x4004e | ||
79 | #define PME_PM_GCT_NOSLOT_IC_MISS 0x2001a | ||
80 | #define PME_PM_GCT_NOSLOT_BR_MPRED 0x4001a | ||
81 | #define PME_PM_GCT_NOSLOT_BR_MPRED_IC_MISS 0x4001c | ||
82 | #define PME_PM_GRP_CMPL 0x30004 | ||
83 | #define PME_PM_1PLUS_PPC_CMPL 0x100f2 | ||
84 | #define PME_PM_CMPLU_STALL_DFU 0x2003c | ||
85 | #define PME_PM_RUN_CYC 0x200f4 | ||
86 | #define PME_PM_RUN_INST_CMPL 0x400fa | ||
87 | 63 | ||
88 | /* | 64 | /* |
89 | * Layout of constraint bits: | 65 | * Layout of constraint bits: |
@@ -398,96 +374,36 @@ static int power7_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { | |||
398 | }; | 374 | }; |
399 | 375 | ||
400 | 376 | ||
401 | GENERIC_EVENT_ATTR(cpu-cycles, CYC); | 377 | GENERIC_EVENT_ATTR(cpu-cycles, PM_CYC); |
402 | GENERIC_EVENT_ATTR(stalled-cycles-frontend, GCT_NOSLOT_CYC); | 378 | GENERIC_EVENT_ATTR(stalled-cycles-frontend, PM_GCT_NOSLOT_CYC); |
403 | GENERIC_EVENT_ATTR(stalled-cycles-backend, CMPLU_STALL); | 379 | GENERIC_EVENT_ATTR(stalled-cycles-backend, PM_CMPLU_STALL); |
404 | GENERIC_EVENT_ATTR(instructions, INST_CMPL); | 380 | GENERIC_EVENT_ATTR(instructions, PM_INST_CMPL); |
405 | GENERIC_EVENT_ATTR(cache-references, LD_REF_L1); | 381 | GENERIC_EVENT_ATTR(cache-references, PM_LD_REF_L1); |
406 | GENERIC_EVENT_ATTR(cache-misses, LD_MISS_L1); | 382 | GENERIC_EVENT_ATTR(cache-misses, PM_LD_MISS_L1); |
407 | GENERIC_EVENT_ATTR(branch-instructions, BRU_FIN); | 383 | GENERIC_EVENT_ATTR(branch-instructions, PM_BRU_FIN); |
408 | GENERIC_EVENT_ATTR(branch-misses, BR_MPRED); | 384 | GENERIC_EVENT_ATTR(branch-misses, PM_BR_MPRED); |
409 | 385 | ||
410 | POWER_EVENT_ATTR(CYC, CYC); | 386 | #define EVENT(_name, _code) POWER_EVENT_ATTR(_name, _name); |
411 | POWER_EVENT_ATTR(GCT_NOSLOT_CYC, GCT_NOSLOT_CYC); | 387 | #include "power7-events-list.h" |
412 | POWER_EVENT_ATTR(CMPLU_STALL, CMPLU_STALL); | 388 | #undef EVENT |
413 | POWER_EVENT_ATTR(INST_CMPL, INST_CMPL); | 389 | |
414 | POWER_EVENT_ATTR(LD_REF_L1, LD_REF_L1); | 390 | #define EVENT(_name, _code) POWER_EVENT_PTR(_name), |
415 | POWER_EVENT_ATTR(LD_MISS_L1, LD_MISS_L1); | ||
416 | POWER_EVENT_ATTR(BRU_FIN, BRU_FIN) | ||
417 | POWER_EVENT_ATTR(BR_MPRED, BR_MPRED); | ||
418 | |||
419 | POWER_EVENT_ATTR(CMPLU_STALL_FXU, CMPLU_STALL_FXU); | ||
420 | POWER_EVENT_ATTR(CMPLU_STALL_DIV, CMPLU_STALL_DIV); | ||
421 | POWER_EVENT_ATTR(CMPLU_STALL_SCALAR, CMPLU_STALL_SCALAR); | ||
422 | POWER_EVENT_ATTR(CMPLU_STALL_SCALAR_LONG, CMPLU_STALL_SCALAR_LONG); | ||
423 | POWER_EVENT_ATTR(CMPLU_STALL_VECTOR, CMPLU_STALL_VECTOR); | ||
424 | POWER_EVENT_ATTR(CMPLU_STALL_VECTOR_LONG, CMPLU_STALL_VECTOR_LONG); | ||
425 | POWER_EVENT_ATTR(CMPLU_STALL_LSU, CMPLU_STALL_LSU); | ||
426 | POWER_EVENT_ATTR(CMPLU_STALL_REJECT, CMPLU_STALL_REJECT); | ||
427 | |||
428 | POWER_EVENT_ATTR(CMPLU_STALL_ERAT_MISS, CMPLU_STALL_ERAT_MISS); | ||
429 | POWER_EVENT_ATTR(CMPLU_STALL_DCACHE_MISS, CMPLU_STALL_DCACHE_MISS); | ||
430 | POWER_EVENT_ATTR(CMPLU_STALL_STORE, CMPLU_STALL_STORE); | ||
431 | POWER_EVENT_ATTR(CMPLU_STALL_THRD, CMPLU_STALL_THRD); | ||
432 | POWER_EVENT_ATTR(CMPLU_STALL_IFU, CMPLU_STALL_IFU); | ||
433 | POWER_EVENT_ATTR(CMPLU_STALL_BRU, CMPLU_STALL_BRU); | ||
434 | POWER_EVENT_ATTR(GCT_NOSLOT_IC_MISS, GCT_NOSLOT_IC_MISS); | ||
435 | |||
436 | POWER_EVENT_ATTR(GCT_NOSLOT_BR_MPRED, GCT_NOSLOT_BR_MPRED); | ||
437 | POWER_EVENT_ATTR(GCT_NOSLOT_BR_MPRED_IC_MISS, GCT_NOSLOT_BR_MPRED_IC_MISS); | ||
438 | POWER_EVENT_ATTR(GRP_CMPL, GRP_CMPL); | ||
439 | POWER_EVENT_ATTR(1PLUS_PPC_CMPL, 1PLUS_PPC_CMPL); | ||
440 | POWER_EVENT_ATTR(CMPLU_STALL_DFU, CMPLU_STALL_DFU); | ||
441 | POWER_EVENT_ATTR(RUN_CYC, RUN_CYC); | ||
442 | POWER_EVENT_ATTR(RUN_INST_CMPL, RUN_INST_CMPL); | ||
443 | 391 | ||
444 | static struct attribute *power7_events_attr[] = { | 392 | static struct attribute *power7_events_attr[] = { |
445 | GENERIC_EVENT_PTR(CYC), | 393 | GENERIC_EVENT_PTR(PM_CYC), |
446 | GENERIC_EVENT_PTR(GCT_NOSLOT_CYC), | 394 | GENERIC_EVENT_PTR(PM_GCT_NOSLOT_CYC), |
447 | GENERIC_EVENT_PTR(CMPLU_STALL), | 395 | GENERIC_EVENT_PTR(PM_CMPLU_STALL), |
448 | GENERIC_EVENT_PTR(INST_CMPL), | 396 | GENERIC_EVENT_PTR(PM_INST_CMPL), |
449 | GENERIC_EVENT_PTR(LD_REF_L1), | 397 | GENERIC_EVENT_PTR(PM_LD_REF_L1), |
450 | GENERIC_EVENT_PTR(LD_MISS_L1), | 398 | GENERIC_EVENT_PTR(PM_LD_MISS_L1), |
451 | GENERIC_EVENT_PTR(BRU_FIN), | 399 | GENERIC_EVENT_PTR(PM_BRU_FIN), |
452 | GENERIC_EVENT_PTR(BR_MPRED), | 400 | GENERIC_EVENT_PTR(PM_BR_MPRED), |
453 | 401 | ||
454 | POWER_EVENT_PTR(CYC), | 402 | #include "power7-events-list.h" |
455 | POWER_EVENT_PTR(GCT_NOSLOT_CYC), | 403 | #undef EVENT |
456 | POWER_EVENT_PTR(CMPLU_STALL), | ||
457 | POWER_EVENT_PTR(INST_CMPL), | ||
458 | POWER_EVENT_PTR(LD_REF_L1), | ||
459 | POWER_EVENT_PTR(LD_MISS_L1), | ||
460 | POWER_EVENT_PTR(BRU_FIN), | ||
461 | POWER_EVENT_PTR(BR_MPRED), | ||
462 | |||
463 | POWER_EVENT_PTR(CMPLU_STALL_FXU), | ||
464 | POWER_EVENT_PTR(CMPLU_STALL_DIV), | ||
465 | POWER_EVENT_PTR(CMPLU_STALL_SCALAR), | ||
466 | POWER_EVENT_PTR(CMPLU_STALL_SCALAR_LONG), | ||
467 | POWER_EVENT_PTR(CMPLU_STALL_VECTOR), | ||
468 | POWER_EVENT_PTR(CMPLU_STALL_VECTOR_LONG), | ||
469 | POWER_EVENT_PTR(CMPLU_STALL_LSU), | ||
470 | POWER_EVENT_PTR(CMPLU_STALL_REJECT), | ||
471 | |||
472 | POWER_EVENT_PTR(CMPLU_STALL_ERAT_MISS), | ||
473 | POWER_EVENT_PTR(CMPLU_STALL_DCACHE_MISS), | ||
474 | POWER_EVENT_PTR(CMPLU_STALL_STORE), | ||
475 | POWER_EVENT_PTR(CMPLU_STALL_THRD), | ||
476 | POWER_EVENT_PTR(CMPLU_STALL_IFU), | ||
477 | POWER_EVENT_PTR(CMPLU_STALL_BRU), | ||
478 | POWER_EVENT_PTR(GCT_NOSLOT_IC_MISS), | ||
479 | POWER_EVENT_PTR(GCT_NOSLOT_BR_MPRED), | ||
480 | |||
481 | POWER_EVENT_PTR(GCT_NOSLOT_BR_MPRED_IC_MISS), | ||
482 | POWER_EVENT_PTR(GRP_CMPL), | ||
483 | POWER_EVENT_PTR(1PLUS_PPC_CMPL), | ||
484 | POWER_EVENT_PTR(CMPLU_STALL_DFU), | ||
485 | POWER_EVENT_PTR(RUN_CYC), | ||
486 | POWER_EVENT_PTR(RUN_INST_CMPL), | ||
487 | NULL | 404 | NULL |
488 | }; | 405 | }; |
489 | 406 | ||
490 | |||
491 | static struct attribute_group power7_pmu_events_group = { | 407 | static struct attribute_group power7_pmu_events_group = { |
492 | .name = "events", | 408 | .name = "events", |
493 | .attrs = power7_events_attr, | 409 | .attrs = power7_events_attr, |