diff options
author | Will Deacon <will.deacon@arm.com> | 2015-12-22 09:42:57 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-12-22 09:42:57 -0500 |
commit | abff083ce2046b4d55211c1db5992ec2dd391f3d (patch) | |
tree | 71d68d01315e37875b6811a7786bc065334724dc | |
parent | 60792ad349f3c6dc5735aafefe5dc9121c79e320 (diff) |
ARM: perf: add format entry to describe event -> config mapping
It's all very well providing an events directory to userspace that
details our events in terms of "event=0xNN", but if we don't define how
to encode the "event" field in the perf attr.config, then it's a waste
of time.
This patch adds a single format entry to describe that the event field
occupies the bottom 8 bits of our config field on ARMv7.
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm/kernel/perf_event_v7.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index 970e1364e484..4152158f6e6a 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c | |||
@@ -531,6 +531,18 @@ static const unsigned scorpion_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | |||
531 | [C(BPU)][C(OP_WRITE)][C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | 531 | [C(BPU)][C(OP_WRITE)][C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, |
532 | }; | 532 | }; |
533 | 533 | ||
534 | PMU_FORMAT_ATTR(event, "config:0-7"); | ||
535 | |||
536 | static struct attribute *armv7_pmu_format_attrs[] = { | ||
537 | &format_attr_event.attr, | ||
538 | NULL, | ||
539 | }; | ||
540 | |||
541 | static struct attribute_group armv7_pmu_format_attr_group = { | ||
542 | .name = "format", | ||
543 | .attrs = armv7_pmu_format_attrs, | ||
544 | }; | ||
545 | |||
534 | #define ARMV7_EVENT_ATTR_RESOLVE(m) #m | 546 | #define ARMV7_EVENT_ATTR_RESOLVE(m) #m |
535 | #define ARMV7_EVENT_ATTR(name, config) \ | 547 | #define ARMV7_EVENT_ATTR(name, config) \ |
536 | PMU_EVENT_ATTR_STRING(name, armv7_event_attr_##name, \ | 548 | PMU_EVENT_ATTR_STRING(name, armv7_event_attr_##name, \ |
@@ -576,7 +588,7 @@ static struct attribute *armv7_pmuv1_event_attrs[] = { | |||
576 | &armv7_event_attr_br_mis_pred.attr.attr, | 588 | &armv7_event_attr_br_mis_pred.attr.attr, |
577 | &armv7_event_attr_cpu_cycles.attr.attr, | 589 | &armv7_event_attr_cpu_cycles.attr.attr, |
578 | &armv7_event_attr_br_pred.attr.attr, | 590 | &armv7_event_attr_br_pred.attr.attr, |
579 | NULL | 591 | NULL, |
580 | }; | 592 | }; |
581 | 593 | ||
582 | static struct attribute_group armv7_pmuv1_events_attr_group = { | 594 | static struct attribute_group armv7_pmuv1_events_attr_group = { |
@@ -586,7 +598,8 @@ static struct attribute_group armv7_pmuv1_events_attr_group = { | |||
586 | 598 | ||
587 | static const struct attribute_group *armv7_pmuv1_attr_groups[] = { | 599 | static const struct attribute_group *armv7_pmuv1_attr_groups[] = { |
588 | &armv7_pmuv1_events_attr_group, | 600 | &armv7_pmuv1_events_attr_group, |
589 | NULL | 601 | &armv7_pmu_format_attr_group, |
602 | NULL, | ||
590 | }; | 603 | }; |
591 | 604 | ||
592 | ARMV7_EVENT_ATTR(mem_access, ARMV7_PERFCTR_MEM_ACCESS); | 605 | ARMV7_EVENT_ATTR(mem_access, ARMV7_PERFCTR_MEM_ACCESS); |
@@ -632,7 +645,7 @@ static struct attribute *armv7_pmuv2_event_attrs[] = { | |||
632 | &armv7_event_attr_inst_spec.attr.attr, | 645 | &armv7_event_attr_inst_spec.attr.attr, |
633 | &armv7_event_attr_ttbr_write_retired.attr.attr, | 646 | &armv7_event_attr_ttbr_write_retired.attr.attr, |
634 | &armv7_event_attr_bus_cycles.attr.attr, | 647 | &armv7_event_attr_bus_cycles.attr.attr, |
635 | NULL | 648 | NULL, |
636 | }; | 649 | }; |
637 | 650 | ||
638 | static struct attribute_group armv7_pmuv2_events_attr_group = { | 651 | static struct attribute_group armv7_pmuv2_events_attr_group = { |
@@ -642,7 +655,8 @@ static struct attribute_group armv7_pmuv2_events_attr_group = { | |||
642 | 655 | ||
643 | static const struct attribute_group *armv7_pmuv2_attr_groups[] = { | 656 | static const struct attribute_group *armv7_pmuv2_attr_groups[] = { |
644 | &armv7_pmuv2_events_attr_group, | 657 | &armv7_pmuv2_events_attr_group, |
645 | NULL | 658 | &armv7_pmu_format_attr_group, |
659 | NULL, | ||
646 | }; | 660 | }; |
647 | 661 | ||
648 | /* | 662 | /* |