Skip to content

Commit

Permalink
arm64: perf: add format entry to describe event -> config mapping
Browse files Browse the repository at this point in the history
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 10 bits of our config field on ARMv8 (PMUv3).

Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Will Deacon committed Dec 22, 2015
1 parent abff083 commit 57d7412
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions arch/arm64/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,33 @@ static struct attribute *armv8_pmuv3_event_attrs[] = {
&armv8_event_attr_l21_tlb_refill.attr.attr,
&armv8_event_attr_l2d_tlb.attr.attr,
&armv8_event_attr_l21_tlb.attr.attr,
NULL
NULL,
};

static struct attribute_group armv8_pmuv3_events_attr_group = {
.name = "events",
.attrs = armv8_pmuv3_event_attrs,
};

PMU_FORMAT_ATTR(event, "config:0-9");

static struct attribute *armv8_pmuv3_format_attrs[] = {
&format_attr_event.attr,
NULL,
};

static struct attribute_group armv8_pmuv3_format_attr_group = {
.name = "format",
.attrs = armv8_pmuv3_format_attrs,
};

static const struct attribute_group *armv8_pmuv3_attr_groups[] = {
&armv8_pmuv3_events_attr_group,
NULL
&armv8_pmuv3_format_attr_group,
NULL,
};


/*
* Perf Events' indices
*/
Expand Down

0 comments on commit 57d7412

Please sign in to comment.