Skip to content

perf stat: Make some of the stat code generic

Jiri Olsa lkml 1 version Applied

Status from this message: Thanks, applied,

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest43 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/43perf stat: Use evsel->threads in create_perf_stat_countertools/perf/builtin-stat.c+1 -10 replies
2/43perf stat: Move initial_delay into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+18 -160 replies
3/43perf stat: Move no_inherit into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+3 -30 replies
4/43perf stat: Use local config arg for scale in create_perf_stat_countertools/perf/builtin-stat.c+1 -10 replies
5/43perf stat: Add identifier flag into struct stat_optstools/perf/builtin-stat.c tools/perf/util/stat.h+13 -100 replies
6/43perf tools: Switch session argument to evlist in perf_event__synthesize_attrstools/perf/builtin-record.c tools/perf/builtin-stat.c tools/perf/util/header.c +1 more+6 -60 replies
7/43perf tools: Add perf_evsel__store_ids functiontools/perf/builtin-stat.c tools/perf/util/evsel.c tools/perf/util/evsel.h+31 -320 replies
8/43perf stat: Move create_perf_stat_counter into stat.ctools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+58 -530 replies
9/43perf stat: Rename is_pipe argument to attrs perf_stat_synthesize_configtools/perf/builtin-stat.c+3 -30 replies
10/43perf stat: Add struct perf_stat_config argument to perf_stat_synthesize_configtools/perf/builtin-stat.c+4 -30 replies
11/43perf stat: Add struct perf_tool argument to perf_stat_synthesize_configtools/perf/builtin-stat.c+7 -60 replies
12/43perf stat: Add struct perf_evlist argument to perf_stat_synthesize_configtools/perf/builtin-stat.c+7 -60 replies
13/43perf stat: Add perf_event__handler_t argument to perf_stat_synthesize_configtools/perf/builtin-stat.c+7 -100 replies
14/43perf stat: Move perf_stat_synthesize_config into stat.ctools/perf/builtin-stat.c tools/perf/util/stat.c tools/perf/util/stat.h+48 -420 replies
15/43perf stat: Add perf_evlist__print_counters functiontools/perf/builtin-stat.c+12 -40 replies
16/43perf stat: Move STAT_RECORD out of perf_evlist__print_counterstools/perf/builtin-stat.c+4 -40 replies
17/43perf stat: Add stat_config argument to perf_evlist__print_counterstools/perf/builtin-stat.c+9 -70 replies
18/43perf stat: Pass stat_config argument to local print functionstools/perf/builtin-stat.c+80 -690 replies
19/43perf stat: Pass stat_config argument to global print functionstools/perf/builtin-script.c tools/perf/builtin-stat.c tools/perf/util/stat-shadow.c +1 more+131 -1060 replies
20/43perf stat: Move csv_* into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+58 -580 replies
21/43perf stat: Move interval_clear into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+5 -50 replies
22/43perf stat: Move metric_only into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+17 -130 replies
23/43perf stat: Move unit_width into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+7 -50 replies
24/43perf stat: Add target argument to perf_evlist__print_counterstools/perf/builtin-stat.c+11 -90 replies
25/43perf stat: Pass evlist argument to print functionstools/perf/builtin-stat.c+13 -90 replies
26/43perf stat: Use evsel->evlist instead of evsel_list in collect_all_aliasestools/perf/builtin-stat.c+3 -20 replies
27/43perf stat: Move run_count into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+21 -190 replies
28/43perf stat: Move metric_only_len into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+6 -50 replies
29/43perf stat: Pass stat_config to first_shadow_cputools/perf/builtin-stat.c+8 -70 replies
30/43perf stat: Pass evlist to aggr_update_shadowtools/perf/builtin-stat.c+4 -30 replies
31/43perf stat: Add walltime_nsecs_stats pointer into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+9 -70 replies
32/43perf stat: Move null_run into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+4 -40 replies
33/43perf stat: Move print_free_counters_hint into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+3 -30 replies
34/43perf stat: Move print_mixed_hw_group_error into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+3 -30 replies
35/43perf stat: Move ru_* data into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+11 -70 replies
36/43perf stat: Move *_aggr_* data into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+64 -540 replies
37/43perf stat: Do not use glovab evsel_list in print functionstools/perf/builtin-stat.c+3 -20 replies
38/43perf stat: Move big_num data into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+5 -40 replies
39/43perf stat: Move no_merge data into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+3 -30 replies
40/43perf stat: Propagate struct target arg to sort_aggr_threadtools/perf/builtin-stat.c+6 -40 replies
41/43perf stat: Move walltime_* data into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+12 -120 replies
42/43perf stat: Move metric_events into struct perf_stat_configtools/perf/builtin-stat.c tools/perf/util/stat.h+5 -60 replies
43/43perf stat: Move display functions into stat-display.ctools/perf/builtin-stat.c tools/perf/util/Build tools/perf/util/stat-display.c +1 more+1173 -11500 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/43] perf stat: Make some of the stat code generic

hi,
while going for the ability to store/display stat data in perf record/top I ended up with bunch of generic patches that make some of the stat functions standalone and simplify/reduce the builtin-stat.c code.

This patchset mostly separates the display functions into separate object, plus several other functions.

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

thanks,
jirka

---
Jiri Olsa (43):
perf stat: Use evsel->threads in create_perf_stat_counter
perf stat: Move initial_delay into struct perf_stat_config
perf stat: Move no_inherit into struct perf_stat_config
perf stat: Use local config arg for scale in create_perf_stat_counter perf stat: Add identifier flag into struct stat_opts
perf tools: Switch session argument to evlist in perf_event__synthesize_attrs perf tools: Add perf_evsel__store_ids function
perf stat: Move create_perf_stat_counter into stat.c
perf stat: Rename is_pipe argument to attrs perf_stat_synthesize_config perf stat: Add struct perf_stat_config argument to perf_stat_synthesize_config perf stat: Add struct perf_tool argument to perf_stat_synthesize_config perf stat: Add struct perf_evlist argument to perf_stat_synthesize_config perf stat: Add perf_event__handler_t argument to perf_stat_synthesize_config perf stat: Move perf_stat_synthesize_config into stat.c
perf stat: Add perf_evlist__print_counters function
perf stat: Move STAT_RECORD out of perf_evlist__print_counters perf stat: Add stat_config argument to perf_evlist__print_counters perf stat: Pass stat_config argument to local print functions perf stat: Pass stat_config argument to global print functions perf stat: Move csv_* into struct perf_stat_config
perf stat: Move interval_clear into struct perf_stat_config
perf stat: Move metric_only into struct perf_stat_config
perf stat: Move unit_width into struct perf_stat_config
perf stat: Add target argument to perf_evlist__print_counters perf stat: Pass evlist argument to print functions
perf stat: Use evsel->evlist instead of evsel_list in collect_all_aliases perf stat: Move run_count into struct perf_stat_config
perf stat: Move metric_only_len into struct perf_stat_config perf stat: Pass stat_config to first_shadow_cpu
perf stat: Pass evlist to aggr_update_shadow
perf stat: Add walltime_nsecs_stats pointer into struct perf_stat_config perf stat: Move null_run into struct perf_stat_config
perf stat: Move print_free_counters_hint into struct perf_stat_config perf stat: Move print_mixed_hw_group_error into struct perf_stat_config perf stat: Move ru_* data into struct perf_stat_config
perf stat: Move *_aggr_* data into struct perf_stat_config
perf stat: Do not use glovab evsel_list in print functions
perf stat: Move big_num data into struct perf_stat_config
perf stat: Move no_merge data into struct perf_stat_config
perf stat: Propagate struct target arg to sort_aggr_thread
perf stat: Move walltime_* data into struct perf_stat_config perf stat: Move metric_events into struct perf_stat_config
perf stat: Move display functions into stat-display.c

 tools/perf/builtin-record.c    |    2 +-
 tools/perf/builtin-script.c    |    8 +-
 tools/perf/builtin-stat.c      | 1440 +++++++++--------------------------------------------------------------------------------------------------------------
 tools/perf/util/Build          |    1 +
 tools/perf/util/evsel.c        |   29 +++
 tools/perf/util/evsel.h        |    1 +
 tools/perf/util/header.c       |    6 +-
 tools/perf/util/header.h       |    2 +-
 tools/perf/util/stat-display.c | 1166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/stat-shadow.c  |  147 +++++++------
 tools/perf/util/stat.c         |   95 ++++++++
 tools/perf/util/stat.h         |   72 +++++-
 12 files changed, 1545 insertions(+), 1424 deletions(-)
 create mode 100644 tools/perf/util/stat-display.c