Skip to content

perf metric: Add support to reuse metric

Jiri Olsa lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest19 patches 9 repliesIn review
  2. v319 patches 67 repliesApplied
  3. v118 patches 39 repliesApplied

Changes in v4 from the cover letter

- removed acks from patch because it changed a bit
with the last fixes:
perf metric: Collect referenced metrics in struct metric_ref_node
- fixed runtime metrics [Kajol Jain]
- increased recursion depth [Paul A. Clarke]
- changed patches due to dependencies:
perf metric: Collect referenced metrics in struct metric_ref_node perf metric: Add recursion check when processing nested metrics perf metric: Rename struct egroup to metric
perf metric: Rename group_list to metric_list

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19perf metric: Fix memory leak in expr__add_id functiontools/perf/util/expr.c+2 -00 replies
2/19perf metric: Add expr__add_id functiontools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+27 -70 replies
3/19perf metric: Change expr__get_id to return struct expr_id_datatools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+14 -130 replies
4/19perf metric: Add expr__del_id functiontools/perf/util/expr.c tools/perf/util/expr.h+14 -80 replies
5/19perf metric: Add macros for iterating map eventstools/perf/util/metricgroup.c+40 -370 replies
6/19perf metric: Add add_metric functiontools/perf/util/metricgroup.c+36 -260 replies
7/19perf metric: Rename __metricgroup__add_metric to __add_metrictools/perf/util/metricgroup.c+6 -110 replies
8/19perf metric: Collect referenced metrics in struct metric_ref_nodetools/perf/util/metricgroup.c+156 -140 replies
9/19perf metric: Collect referenced metrics in struct metric_exprtools/perf/util/metricgroup.c tools/perf/util/metricgroup.h+38 -00 replies
10/19perf metric: Add referenced metrics to hash datatools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/stat-shadow.c+80 -70 replies
11/19perf metric: Compute referenced metricstools/perf/util/expr.c tools/perf/util/expr.h tools/perf/util/expr.y+36 -20 replies
12/19perf metric: Add events for the current listtools/perf/util/metricgroup.c+6 -30 replies
13/19perf metric: Add cache_miss_cycles to metric parse testtools/perf/tests/parse-metric.c+33 -00 replies
14/19perf metric: Add DCache_L2 to metric parse testtools/perf/tests/parse-metric.c+71 -00 replies
15/19perf metric: Add recursion check when processing nested metricstools/perf/tests/parse-metric.c tools/perf/util/expr.c tools/perf/util/expr.h +1 more+149 -130 replies
16/19perf metric: Make compute_single function more precisetools/perf/tests/parse-metric.c+13 -90 replies
17/19perf metric: Add metric group testtools/perf/tests/parse-metric.c+46 -20 replies
18/19perf metric: Rename struct egroup to metrictools/perf/util/metricgroup.c+71 -710 replies
19/19perf metric: Rename group_list to metric_listtools/perf/util/metricgroup.c+21 -210 replies

Reviews trailers per patch

17 of 19 patches have a Reviewed-by or Acked-by.

PatchIan RogersKajol JainPaul A. Clarke
SeriesT-b
1/19A-b
2/19A-b R-b
3/19A-b R-b
4/19A-b R-b
5/19A-b R-b
6/19A-b R-b
7/19A-b R-b
8/19
9/19A-b R-b
10/19A-b R-b
11/19A-b R-b
12/19A-b R-b
13/19A-b R-b
14/19A-b R-b
15/19A-b R-b
16/19
17/19A-b R-b
18/19A-b R-b
19/19A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCHv4 00/19] perf metric: Add support to reuse metric

hi,
this patchset is adding the support to reused metric in another metric.

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/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.

v4 changes:
- removed acks from patch because it changed a bit
with the last fixes:
perf metric: Collect referenced metrics in struct metric_ref_node
- fixed runtime metrics [Kajol Jain]
- increased recursion depth [Paul A. Clarke]
- changed patches due to dependencies:
perf metric: Collect referenced metrics in struct metric_ref_node perf metric: Add recursion check when processing nested metrics perf metric: Rename struct egroup to metric
perf metric: Rename group_list to metric_list

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

thanks,
jirka

---
Jiri Olsa (19):
perf metric: Fix memory leak in expr__add_id function perf metric: Add expr__add_id function
perf metric: Change expr__get_id to return struct expr_id_data perf metric: Add expr__del_id function
perf metric: Add macros for iterating map events
perf metric: Add add_metric function
perf metric: Rename __metricgroup__add_metric to __add_metric perf metric: Collect referenced metrics in struct metric_ref_node perf metric: Collect referenced metrics in struct metric_expr perf metric: Add referenced metrics to hash data
perf metric: Compute referenced metrics
perf metric: Add events for the current list
perf metric: Add cache_miss_cycles to metric parse test perf metric: Add DCache_L2 to metric parse test
perf metric: Add recursion check when processing nested metrics perf metric: Make compute_single function more precise perf metric: Add metric group test
perf metric: Rename struct egroup to metric
perf metric: Rename group_list to metric_list

 tools/perf/tests/parse-metric.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++++----
 tools/perf/util/expr.c          | 143 ++++++++++++++++++++++++++++++++-----
 tools/perf/util/expr.h          |  30 +++++++-
 tools/perf/util/expr.y          |  16 +++--
 tools/perf/util/metricgroup.c   | 466 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
 tools/perf/util/metricgroup.h   |   6 ++
 tools/perf/util/stat-shadow.c   |  20 ++++--
 7 files changed, 751 insertions(+), 136 deletions(-)