Skip to content

Intel TPEBS min/max/mean/last support

Ian Rogers linux-perf-users lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest16 patches 7 repliesIn review
  2. v4 posting 2/216 patches 4 repliesSuperseded
  3. v4 posting 1/27 of 16 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v316 patches0 repliesSuperseded
v216 patches8 repliesSuperseded
v114 patches0 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16perf intel-tpebs: Cleanup headertools/perf/util/Build tools/perf/util/intel-tpebs.c tools/perf/util/intel-tpebs.h+8 -250 replies
2/16perf intel-tpebs: Simplify tpebs_cmdtools/perf/util/intel-tpebs.c+18 -370 replies
3/16perf intel-tpebs: Rename tpebs_start to evsel__tpebs_opentools/perf/util/evsel.c tools/perf/util/intel-tpebs.c tools/perf/util/intel-tpebs.h+18 -190 replies
4/16perf intel-tpebs: Separate evsel__tpebs_prepare out of evsel__tpebs_opentools/perf/util/intel-tpebs.c+86 -470 replies
5/16perf intel-tpebs: Move cpumap_buf out of evsel__tpebs_opentools/perf/util/intel-tpebs.c+6 -80 replies
6/16perf intel-tpebs: Reduce scope of tpebs_events_sizetools/perf/util/intel-tpebs.c+6 -30 replies
7/16perf intel-tpebs: Inline get_perf_record_argstools/perf/util/intel-tpebs.c+28 -470 replies
8/16perf intel-tpebs: Ensure events are opened, factor out findingtools/perf/util/intel-tpebs.c+37 -240 replies
9/16perf intel-tpebs: Refactor tpebs_results listtools/perf/builtin-stat.c tools/perf/util/evlist.c tools/perf/util/evsel.c +2 more+93 -642 replies
10/16perf intel-tpebs: Add support for updating counts in evsel__tpebs_readtools/perf/util/evsel.c tools/perf/util/intel-tpebs.c tools/perf/util/intel-tpebs.h+25 -400 replies
11/16perf intel-tpebs: Add mutex for tpebs_resultstools/perf/util/intel-tpebs.c+46 -80 replies
12/16perf intel-tpebs: Don't close record on readtools/perf/util/evsel.c tools/perf/util/intel-tpebs.c+129 -730 replies
13/16perf intel-tpebs: Use stats for retirement latency statisticstools/perf/util/intel-tpebs.c+5 -100 replies
14/16perf stat: Add mean, min, max and last --tpebs-mode optionstools/perf/Documentation/perf-stat.txt tools/perf/builtin-stat.c tools/perf/util/intel-tpebs.c +1 more+61 -12 replies
15/16perf pmu-events: Add retirement latency to JSON events inside of perftools/perf/pmu-events/empty-pmu-events.c tools/perf/pmu-events/jevents.py tools/perf/pmu-events/pmu-events.h +5 more+220 -1220 replies
16/16perf record: Retirement latency cleanup in evsel__configtools/perf/util/evsel.c+3 -20 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWeilin WangNamhyung KimKan Liang
SeriesR-b
1/16T-b A-b
2/16T-b A-b
3/16T-b A-b
4/16T-b A-b
5/16T-b A-b
6/16T-b A-b
7/16T-b A-b
8/16T-b A-b
9/16T-b A-b
10/16T-b A-b
11/16T-b A-b
12/16T-b A-b
13/16T-b A-b
14/16T-b A-b
15/16T-b A-b
16/16T-b A-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 v5 thread

Cover letter [PATCH v5 00/16] Intel TPEBS min/max/mean/last support

The patches add support to computing the min, max, mean or last retirement latency and then using that value as the basis for metrics. When values aren't available, support is added to use the retirement latency as recorded for an event in the perf json.

Support is added for reading the retirement latency from the forked perf command more than once. To avoid killing the process commands are sent through the control fd. Some name handling is changed to make it more robust.

Rather than retirement latency events having issues with perf record, make it so that the retirement latency modifier enables sample weights.

Note: the retirement latency JSON updates are part of:
https://lore.kernel.org/lkml/[email protected]/

v5: Add Namhyung and Weilin's tags. Fix missing error path mutex
unlock spotted by Namhyung.

v4: Don't use json min/max in retirement latency stats as they will
never update afterwards. Warn once if json data is used when TPEBS recording was requested.

v3: Two fixes from Kan Liang. Ensure min/max statistics don't vary
when real samples are encountered.

v2: Addition of header cleanup patch originally posted:
https://lore.kernel.org/lkml/[email protected]/
as there are no arch specific reasons not to build this code. Fix bug in "perf pmu-events: Add retirement latency to JSON events inside of perf" where "t->stats.n != 0" should have been "t->stats.n == 0".
Add patch so that perf record of a retirement latency event doesn't crash but instead enables sample weights for the event.

Ian Rogers (16):
perf intel-tpebs: Cleanup header
perf intel-tpebs: Simplify tpebs_cmd
perf intel-tpebs: Rename tpebs_start to evsel__tpebs_open perf intel-tpebs: Separate evsel__tpebs_prepare out of
evsel__tpebs_open
perf intel-tpebs: Move cpumap_buf out of evsel__tpebs_open perf intel-tpebs: Reduce scope of tpebs_events_size
perf intel-tpebs: Inline get_perf_record_args
perf intel-tpebs: Ensure events are opened, factor out finding perf intel-tpebs: Refactor tpebs_results list
perf intel-tpebs: Add support for updating counts in evsel__tpebs_read perf intel-tpebs: Add mutex for tpebs_results
perf intel-tpebs: Don't close record on read
perf intel-tpebs: Use stats for retirement latency statistics perf stat: Add mean, min, max and last --tpebs-mode options perf pmu-events: Add retirement latency to JSON events inside of perf perf record: Retirement latency cleanup in evsel__config

 tools/perf/Documentation/perf-stat.txt   |   7 +
 tools/perf/builtin-stat.c                |  29 +-
 tools/perf/pmu-events/empty-pmu-events.c | 216 +++----
 tools/perf/pmu-events/jevents.py         |   6 +
 tools/perf/pmu-events/pmu-events.h       |   3 +
 tools/perf/util/Build                    |   2 +-
 tools/perf/util/evlist.c                 |   1 -
 tools/perf/util/evsel.c                  |  22 +-
 tools/perf/util/evsel.h                  |   6 +
 tools/perf/util/intel-tpebs.c            | 682 ++++++++++++++---------
 tools/perf/util/intel-tpebs.h            |  40 +-
 tools/perf/util/parse-events.c           |   4 +
 tools/perf/util/pmu.c                    |  52 +-
 tools/perf/util/pmu.h                    |   3 +
 14 files changed, 666 insertions(+), 407 deletions(-)
Signature · 1 line
2.49.0.604.gff1f9ca942-goog