Skip to content

RFC perf tools: Add support to reuse metric

Jiri Olsa lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 37 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10perf tools: Rename expr__add_id to expr__add_valtools/perf/tests/expr.c tools/perf/tests/pmu-events.c tools/perf/util/expr.c +3 more+9 -93 replies
2/10perf tools: Add struct expr_parse_data to keep expr valuetools/perf/tests/expr.c tools/perf/util/expr.c tools/perf/util/expr.h +1 more+17 -123 replies
3/10perf tools: Add expr__add_id functiontools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+25 -72 replies
4/10perf tools: Change expr__get_id to return struct expr_parse_datatools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+14 -131 reply
5/10perf tools: Add expr__del_id functiontools/perf/util/expr.c tools/perf/util/expr.h+14 -82 replies
6/10perf tools: Collect other metrics in struct egrouptools/perf/pmu-events/arch/x86/skylake/skl-metrics.json tools/perf/util/expr.c tools/perf/util/expr.h +1 more+157 -155 replies
7/10perf tools: Collect other metrics in struct metric_exprtools/perf/util/metricgroup.c tools/perf/util/metricgroup.h+33 -03 replies
8/10perf tools: Add other metrics to hash datatools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/stat-shadow.c+60 -72 replies
9/10perf tools: Compute other metricstools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+23 -14 replies
10/10perf tests: Add cache_miss_cycles to metric parse testtools/perf/tests/parse-metric.c+33 -02 replies

Reviews trailers per patch

3 of 10 patches have a Reviewed-by or Acked-by.

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

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

Read the v1 thread

Cover letter [RFC 00/10] perf tools: Add support to reuse metric

hi,
this patchset is adding the support to reused metric in another metric. The metric needs to be referenced by 'metric:' prefix.

For example, to define IPC by using CPI with change like:

"BriefDescription": "Instructions Per Cycle (per Logical Processor)",
- "MetricExpr": "INST_RETIRED.ANY / CPU_CLK_UNHALTED.THREAD",
+ "MetricExpr": "1/metric:CPI",

         "MetricGroup": "TopDownL1",
         "MetricName": "IPC"

I won't be able to find all the possible places we could use this at, so I wonder you guys (who was asking for this) would try it and come up with comments if there's something missing or we could already use it at some places.

It's based on Arnaldo's tmp.perf/core.

Also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/metric

thanks,
jirka

---
Jiri Olsa (10):
perf tools: Rename expr__add_id to expr__add_val
perf tools: Add struct expr_parse_data to keep expr value perf tools: Add expr__add_id function
perf tools: Change expr__get_id to return struct expr_parse_data perf tools: Add expr__del_id function
perf tools: Collect other metrics in struct egroup perf tools: Collect other metrics in struct metric_expr perf tools: Add other metrics to hash data
perf tools: Compute other metrics
perf tests: Add cache_miss_cycles to metric parse test

 tools/perf/pmu-events/arch/x86/skylake/skl-metrics.json |   2 +-
 tools/perf/tests/expr.c                                 |   7 ++--
 tools/perf/tests/parse-metric.c                         |  33 +++++++++++++++++
 tools/perf/tests/pmu-events.c                           |   4 +--
 tools/perf/util/expr.c                                  | 115 +++++++++++++++++++++++++++++++++++++++++++++-------------
 tools/perf/util/expr.h                                  |  24 +++++++++++--
 tools/perf/util/expr.y                                  |  34 ++++++++++++++----
 tools/perf/util/metricgroup.c                           | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 tools/perf/util/metricgroup.h                           |   6 ++++
 tools/perf/util/stat-shadow.c                           |  23 +++++++-----
 10 files changed, 374 insertions(+), 61 deletions(-)