Skip to content

perf stat: Cleanup counter aggregation (v1)

Namhyung Kim linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest19 patches 41 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19perf tools: Save evsel->pmu in parse_events()tools/perf/util/evsel.c tools/perf/util/parse-events.c tools/perf/util/pmu.c+6 -01 reply
2/19perf tools: Use pmu info in evsel__is_hybrid()tools/perf/util/evsel.c+3 -02 replies
3/19perf stat: Use evsel__is_hybrid() moretools/perf/util/stat-display.c+4 -161 reply
4/19perf stat: Add aggr id for global modetools/perf/builtin-stat.c tools/perf/util/cpumap.c tools/perf/util/cpumap.h +1 more+54 -104 replies
5/19perf stat: Add cpu aggr id for no aggregation modetools/perf/builtin-stat.c+43 -53 replies
6/19perf stat: Add 'needs_sort' argument to cpu_aggr_map__new()tools/perf/builtin-stat.c tools/perf/util/cpumap.c tools/perf/util/cpumap.h+10 -52 replies
7/19perf stat: Add struct perf_stat_aggr to perf_stat_evseltools/perf/util/stat.c tools/perf/util/stat.h+36 -72 replies
8/19perf stat: Allocate evsel->stats->aggr properlytools/perf/builtin-script.c tools/perf/builtin-stat.c tools/perf/tests/parse-metric.c +3 more+16 -102 replies
9/19perf stat: Aggregate events using evsel->stats->aggrtools/perf/builtin-stat.c tools/perf/util/evsel.c tools/perf/util/scripting-engines/trace-event-python.c +1 more+41 -232 replies
10/19perf stat: Aggregate per-thread stats using evsel->stats->aggrtools/perf/builtin-stat.c tools/perf/util/stat.c+50 -02 replies
11/19perf stat: Allocate aggr counts for recorded datatools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+41 -81 reply
12/19perf stat: Reset aggr counts for each intervaltools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+17 -02 replies
13/19perf stat: Split process_counters()tools/perf/builtin-stat.c+13 -91 reply
14/19perf stat: Add perf_stat_merge_counters()tools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+100 -02 replies
15/19perf stat: Add perf_stat_process_percore()tools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+74 -02 replies
16/19perf stat: Add perf_stat_process_shadow_stats()tools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+28 -241 reply
17/19perf stat: Display event stats using aggr countstools/perf/util/stat-display.c tools/perf/util/stat.c tools/perf/util/stat.h+55 -3871 reply
18/19perf stat: Display percore events properlytools/perf/builtin-stat.c tools/perf/util/stat-display.c+25 -181 reply
19/19perf stat: Remove unused perf_counts.aggr fieldtools/perf/util/counts.c tools/perf/util/counts.h tools/perf/util/stat.c+2 -354 replies

Reviews trailers per patch

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

PatchIan Rogers
1/19A-b
2/19
3/19A-b
4/19
5/19A-b
6/19
7/19
8/19A-b
9/19
10/19A-b
11/19A-b
12/19
13/19A-b
14/19
15/19
16/19A-b
17/19A-b
18/19A-b
19/19A-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/PATCHSET 00/19] perf stat: Cleanup counter aggregation (v1)

Hello,

Current perf stat code is somewhat hard to follow since it handles many combinations of PMUs/events for given display and aggregation options. This is my attempt to clean it up a little. ;-)

My first concern is that aggregation and display routines are intermixed and processed differently depends on the aggregation mode. I'd like to separate them apart and make the logic clearer.

To do that, I added struct perf_stat_aggr to save the aggregated counter values and other info. It'll be allocated and processed according to the aggr_mode and display logic will use it.

The code is available at 'perf/stat-aggr-v1' branch in

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (19):
perf tools: Save evsel->pmu in parse_events()
perf tools: Use pmu info in evsel__is_hybrid()
perf stat: Use evsel__is_hybrid() more
perf stat: Add aggr id for global mode
perf stat: Add cpu aggr id for no aggregation mode perf stat: Add 'needs_sort' argument to cpu_aggr_map__new() perf stat: Add struct perf_stat_aggr to perf_stat_evsel perf stat: Allocate evsel->stats->aggr properly
perf stat: Aggregate events using evsel->stats->aggr perf stat: Aggregate per-thread stats using evsel->stats->aggr perf stat: Allocate aggr counts for recorded data perf stat: Reset aggr counts for each interval
perf stat: Split process_counters()
perf stat: Add perf_stat_merge_counters()
perf stat: Add perf_stat_process_percore()
perf stat: Add perf_stat_process_shadow_stats()
perf stat: Display event stats using aggr counts perf stat: Display percore events properly
perf stat: Remove unused perf_counts.aggr field

 tools/perf/builtin-script.c                   |   4 +-
 tools/perf/builtin-stat.c                     | 177 +++++--
 tools/perf/tests/parse-metric.c               |   2 +-
 tools/perf/tests/pmu-events.c                 |   2 +-
 tools/perf/util/counts.c                      |   1 -
 tools/perf/util/counts.h                      |   1 -
 tools/perf/util/cpumap.c                      |  16 +-
 tools/perf/util/cpumap.h                      |   8 +-
 tools/perf/util/evsel.c                       |  13 +-
 tools/perf/util/parse-events.c                |   1 +
 tools/perf/util/pmu.c                         |   4 +
 .../scripting-engines/trace-event-python.c    |   6 -
 tools/perf/util/stat-display.c                | 472 +++---------------
 tools/perf/util/stat.c                        | 383 +++++++++++---
 tools/perf/util/stat.h                        |  29 +-
 15 files changed, 590 insertions(+), 529 deletions(-)

base-commit: d79310700590b8b40d8c867012d6c899ea6fd505

Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog