Skip to content

Foundations for metric generation with Python

Ian Rogers linux-perf-users lkml 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest12 patches 0 repliesNew
  2. v512 patches 0 repliesSuperseded
  3. v412 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v312 patches1 replySuperseded
v212 patches2 repliesSuperseded
v112 patches0 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12perf jevents: Allow multiple metricgroups.json filestools/perf/pmu-events/jevents.py+2 -20 replies
2/12perf jevents: Update metric constraint supporttools/perf/pmu-events/metric.py+10 -40 replies
3/12perf jevents: Add descriptions to metricgroup abstractiontools/perf/pmu-events/metric.py+12 -20 replies
4/12perf jevents: Allow metric groups not to be namedtools/perf/pmu-events/metric.py+2 -10 replies
5/12perf jevents: Support parsing negative exponentstools/perf/pmu-events/metric.py tools/perf/pmu-events/metric_test.py+5 -10 replies
6/12perf jevents: Term list fix in event parsingtools/perf/pmu-events/metric.py+6 -10 replies
7/12perf jevents: Add threshold expressions to Metrictools/perf/pmu-events/metric.py+6 -10 replies
8/12perf jevents: Move json encoding to its own functionstools/perf/pmu-events/metric.py+22 -120 replies
9/12perf jevents: Drop duplicate pending metricstools/perf/pmu-events/jevents.py+2 -10 replies
10/12perf jevents: Skip optional metrics in metric group listtools/perf/pmu-events/metric.py+5 -30 replies
11/12perf jevents: Build support for generating metrics from pythontools/perf/.gitignore tools/perf/Makefile.perf tools/perf/pmu-events/Build +3 more+172 -10 replies
12/12perf jevents: Add load event json to verify and allow fallbackstools/perf/pmu-events/Build tools/perf/pmu-events/amd_metrics.py tools/perf/pmu-events/arm64_metrics.py +2 more+101 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 00/12] Foundations for metric generation with Python

Metrics in the perf tool come in via json. Json doesn't allow comments, line breaks, etc. making it an inconvenient way to write metrics. Further, it is useful to detect when writing a metric that the event specified is supported within the event json for a model.

These patches introduce infrastructure and fixes for the addition of metrics written in python for Arm64, AMD Zen and Intel CPUs. Later patches will introduce the metrics split apart by the vendor.

v6. Fix issue with '\-' escape not being '\\-' (reported-by Sandipan
Das <[email protected]>) which didn't alter the generated json.

v5. Rebase on top of legacy hardware/cache changes that now generate
events using python:
https://lore.kernel.org/lkml/[email protected]/
the v5 series is:
https://lore.kernel.org/lkml/[email protected]/

v4. Rebase and small Build/Makefile tweak

    https://lore.kernel.org/lkml/[email protected]/

v3. Some code tidying, make the input directory a command line
argument, but no other functional or output changes.
https://lore.kernel.org/lkml/[email protected]/

v2. Fixes two type issues in the python code but no functional or

    output changes.
    https://lore.kernel.org/lkml/[email protected]/

v1. https://lore.kernel.org/lkml/[email protected]/

Ian Rogers (12):
perf jevents: Allow multiple metricgroups.json files perf jevents: Update metric constraint support
perf jevents: Add descriptions to metricgroup abstraction perf jevents: Allow metric groups not to be named perf jevents: Support parsing negative exponents
perf jevents: Term list fix in event parsing
perf jevents: Add threshold expressions to Metric perf jevents: Move json encoding to its own functions perf jevents: Drop duplicate pending metrics
perf jevents: Skip optional metrics in metric group list perf jevents: Build support for generating metrics from python perf jevents: Add load event json to verify and allow fallbacks

 tools/perf/.gitignore                  |   5 +
 tools/perf/Makefile.perf               |   2 +
 tools/perf/pmu-events/Build            |  51 +++++++-
 tools/perf/pmu-events/amd_metrics.py   |  42 +++++++
 tools/perf/pmu-events/arm64_metrics.py |  43 +++++++
 tools/perf/pmu-events/intel_metrics.py |  42 +++++++
 tools/perf/pmu-events/jevents.py       |   7 +-
 tools/perf/pmu-events/metric.py        | 168 +++++++++++++++++++++----
 tools/perf/pmu-events/metric_test.py   |   4 +
 9 files changed, 334 insertions(+), 30 deletions(-)
 create mode 100755 tools/perf/pmu-events/amd_metrics.py
 create mode 100755 tools/perf/pmu-events/arm64_metrics.py
 create mode 100755 tools/perf/pmu-events/intel_metrics.py
Signature · 1 line
2.51.0.338.gd7d06c2dae-goog