Skip to content

RFC perf tool: sys event metric support re-write

John Garry linux-arm-kernel linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9perf metrics: Delete metricgroup_add_iter_data.tabletools/perf/util/metricgroup.c+2 -41 reply
2/9perf metrics: Don't iter sys metrics if we already found a CPU matchtools/perf/util/metricgroup.c+7 -04 replies
3/9perf metrics: Pass cpu and sys tables to metricgroup__add_metric()tools/perf/tests/expand-cgroup.c tools/perf/tests/parse-metric.c tools/perf/tests/pmu-events.c +2 more+59 -222 replies
4/9perf jevents: Add sys_events_find_events_table()tools/perf/pmu-events/empty-pmu-events.c tools/perf/pmu-events/jevents.py tools/perf/pmu-events/pmu-events.h+20 -017 replies
5/9perf pmu: Refactor pmu_add_sys_aliases_iter_fn()tools/perf/util/pmu.c tools/perf/util/pmu.h+17 -50 replies
6/9perf metrics: Add metricgroup_sys_metric_supported()tools/perf/util/metricgroup.c+105 -100 replies
7/9perf metrics: Test metric match in metricgroup__sys_event_iter()tools/perf/util/metricgroup.c+6 -00 replies
8/9perf metrics: Stop metricgroup__add_metric_sys_event_iter if already matchedtools/perf/util/metricgroup.c+6 -10 replies
9/9perf vendor events arm64: Remove unnecessary metric Unit and Compat specifierstools/perf/pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json +1 more+0 -160 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchIan Rogers
1/9A-b
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/9] perf tool: sys event metric support re-write

The current sys event metric support has some issues, like:
- It is broken that we only match a metric based on PMU compat, but not Unit as well, as reported by Jing Zhang <[email protected]>
- No real self-test support
- Not able to use resolvable metrics
- Need to specify event PMU Unit and Compat for metric, which should not be necessary

This series changes sys event metric support to match metrics based on evaluating each term in the metric expression and then ensuring it matches an event from the same associated pmu_sys_events table.

Why an RFC?
- Even though main motivation here was to improve self-test support, that has proved quite tricky and nothing has been added yet.
My desire is to test the feature that we match metrics for a specific SoC when PMUs with matching HW identifier are present. So I would hope to add sys metrics for many SoCs in ../pmu-events/arch/test/
- I still need to suppress logs from metricgroup_sys_metric_supported() indirect calls to functions like parse_events_multi_pmu_add(), generating logs like
"smmuv3_pmcg.wr_sent_sp -> smmuv3_pmcg_50/event=0x86/" - we should only see those logs for when really adding the metric in calling add_metric()

Based on 82fe2e45cdb0 (acme/tmp.perf/core, acme/tmp.perf-tools-next, acme/perf/core, acme/perf-tools-next) perf pmus: Check if we can encode the PMU number in perf_event_attr.type

John Garry (9):
perf metrics: Delete metricgroup_add_iter_data.table
perf metrics: Don't iter sys metrics if we already found a CPU match perf metrics: Pass cpu and sys tables to metricgroup__add_metric() perf jevents: Add sys_events_find_events_table()
perf pmu: Refactor pmu_add_sys_aliases_iter_fn()
perf metrics: Add metricgroup_sys_metric_supported()
perf metrics: Test metric match in metricgroup__sys_event_iter() perf metrics: Stop metricgroup__add_metric_sys_event_iter if already
matched
perf vendor events arm64: Remove unnecessary metric Unit and Compat
specifiers

 .../arm64/freescale/imx8mm/sys/metrics.json   |   4 -
 .../arm64/freescale/imx8mn/sys/metrics.json   |   4 -
 .../arm64/freescale/imx8mq/sys/metrics.json   |   4 -
 .../arm64/hisilicon/hip09/sys/uncore-cpa.json |   4 -
 tools/perf/pmu-events/empty-pmu-events.c      |   6 +
 tools/perf/pmu-events/jevents.py              |  11 ++
 tools/perf/pmu-events/pmu-events.h            |   3 +
 tools/perf/tests/expand-cgroup.c              |   2 +-
 tools/perf/tests/parse-metric.c               |   2 +-
 tools/perf/tests/pmu-events.c                 |  29 ++-
 tools/perf/util/metricgroup.c                 | 182 +++++++++++++++---
 tools/perf/util/metricgroup.h                 |   3 +-
 tools/perf/util/pmu.c                         |  20 +-
 tools/perf/util/pmu.h                         |   2 +
 14 files changed, 220 insertions(+), 56 deletions(-)
Signature · 7 lines
2.35.3


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel