linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/9]  perf tool: sys event metric support re-write
@ 2023-06-28 10:29 John Garry
  2023-06-28 10:29 ` [PATCH RFC 1/9] perf metrics: Delete metricgroup_add_iter_data.table John Garry
                   ` (9 more replies)
  0 siblings, 10 replies; 37+ messages in thread
From: John Garry @ 2023-06-28 10:29 UTC (permalink / raw)
  To: acme, irogers, namhyung, jolsa
  Cc: linux-arm-kernel, linux-perf-users, linux-kernel, renyu.zj,
	shangxiaojing, zhangshaokun, qiangqing.zhang, kjain, kan.liang,
	John Garry

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 <renyu.zj@linux.alibaba.com>
- 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(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2023-07-19 20:07 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 10:29 [PATCH RFC 0/9] perf tool: sys event metric support re-write John Garry
2023-06-28 10:29 ` [PATCH RFC 1/9] perf metrics: Delete metricgroup_add_iter_data.table John Garry
2023-06-30 17:22   ` Ian Rogers
2023-06-28 10:29 ` [PATCH RFC 2/9] perf metrics: Don't iter sys metrics if we already found a CPU match John Garry
2023-06-30 17:41   ` Ian Rogers
2023-07-03 13:09     ` John Garry
2023-07-12  5:40       ` Ian Rogers
2023-07-12  9:37         ` John Garry
2023-06-28 10:29 ` [PATCH RFC 3/9] perf metrics: Pass cpu and sys tables to metricgroup__add_metric() John Garry
2023-06-30 18:39   ` Ian Rogers
2023-07-03 15:20     ` John Garry
2023-06-28 10:29 ` [PATCH RFC 4/9] perf jevents: Add sys_events_find_events_table() John Garry
2023-06-30 19:00   ` Ian Rogers
2023-06-30 20:16     ` Ian Rogers
2023-07-03 15:15       ` John Garry
2023-07-12  6:05         ` Ian Rogers
2023-07-12 10:55           ` John Garry
2023-07-12 17:52             ` Ian Rogers
2023-07-13 15:06               ` John Garry
2023-07-13 21:35                 ` Ian Rogers
2023-07-14 11:58                   ` John Garry
2023-07-14 15:55                     ` Ian Rogers
2023-07-17  7:41                       ` John Garry
2023-07-17 21:39                         ` Ian Rogers
2023-07-18  9:32                           ` John Garry
2023-07-19 15:25                             ` Ian Rogers
2023-07-19 15:36                               ` John Garry
2023-07-19 15:49                                 ` Ian Rogers
2023-07-19 20:07                               ` Arnaldo Carvalho de Melo
2023-06-28 10:29 ` [PATCH RFC 5/9] perf pmu: Refactor pmu_add_sys_aliases_iter_fn() John Garry
2023-06-28 10:29 ` [PATCH RFC 6/9] perf metrics: Add metricgroup_sys_metric_supported() John Garry
2023-06-28 10:29 ` [PATCH RFC 7/9] perf metrics: Test metric match in metricgroup__sys_event_iter() John Garry
2023-06-28 10:29 ` [PATCH RFC 8/9] perf metrics: Stop metricgroup__add_metric_sys_event_iter if already matched John Garry
2023-06-28 10:29 ` [PATCH RFC 9/9] perf vendor events arm64: Remove unnecessary metric Unit and Compat specifiers John Garry
2023-06-29 22:08 ` [PATCH RFC 0/9] perf tool: sys event metric support re-write Namhyung Kim
2023-06-30  9:35   ` John Garry
2023-06-30 21:07     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).