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:45:07 -0500 |
commit | 57d74123954dfe70fad12724d19f743ed14cec90 (patch) | |
tree | fbba93a862f50a3325df09ddc045d7cd1239670f | |
parent | abff083ce2046b4d55211c1db5992ec2dd391f3d (diff) |
arm64: 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 10 bits of our config field on ARMv8 (PMUv3).
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index f0356a8f6110..6fdcfb671309 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
@@ -297,7 +297,7 @@ static struct attribute *armv8_pmuv3_event_attrs[] = { | |||
297 | &armv8_event_attr_l21_tlb_refill.attr.attr, | 297 | &armv8_event_attr_l21_tlb_refill.attr.attr, |
298 | &armv8_event_attr_l2d_tlb.attr.attr, | 298 | &armv8_event_attr_l2d_tlb.attr.attr, |
299 | &armv8_event_attr_l21_tlb.attr.attr, | 299 | &armv8_event_attr_l21_tlb.attr.attr, |
300 | NULL | 300 | NULL, |
301 | }; | 301 | }; |
302 | 302 | ||
303 | static struct attribute_group armv8_pmuv3_events_attr_group = { | 303 | static struct attribute_group armv8_pmuv3_events_attr_group = { |
@@ -305,11 +305,25 @@ static struct attribute_group armv8_pmuv3_events_attr_group = { | |||
305 | .attrs = armv8_pmuv3_event_attrs, | 305 | .attrs = armv8_pmuv3_event_attrs, |
306 | }; | 306 | }; |
307 | 307 | ||
308 | PMU_FORMAT_ATTR(event, "config:0-9"); | ||
309 | |||
310 | static struct attribute *armv8_pmuv3_format_attrs[] = { | ||
311 | &format_attr_event.attr, | ||
312 | NULL, | ||
313 | }; | ||
314 | |||
315 | static struct attribute_group armv8_pmuv3_format_attr_group = { | ||
316 | .name = "format", | ||
317 | .attrs = armv8_pmuv3_format_attrs, | ||
318 | }; | ||
319 | |||
308 | static const struct attribute_group *armv8_pmuv3_attr_groups[] = { | 320 | static const struct attribute_group *armv8_pmuv3_attr_groups[] = { |
309 | &armv8_pmuv3_events_attr_group, | 321 | &armv8_pmuv3_events_attr_group, |
310 | NULL | 322 | &armv8_pmuv3_format_attr_group, |
323 | NULL, | ||
311 | }; | 324 | }; |
312 | 325 | ||
326 | |||
313 | /* | 327 | /* |
314 | * Perf Events' indices | 328 | * Perf Events' indices |
315 | */ | 329 | */ |