Skip to content

Perf stat --null/offline CPU segv related fixes/tests

Ian Rogers linux-perf-users lkml 2 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 7 repliesApplied
  2. v14 patches 5 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7perf stat: Allow no events to open if this is a "--null" runtools/perf/builtin-stat.c+1 -10 replies
2/7libperf cpumap: Fix perf_cpu_map__max for an empty/NULL maptools/lib/perf/cpumap.c+6 -40 replies
3/7perf cpumap: Add "any" CPU handling to cpu_map__snprint_masktools/perf/util/cpumap.c+7 -20 replies
4/7perf tests stat: Add "--null" coveragetools/perf/tests/shell/stat.sh+12 -00 replies
5/7perf stat: When no events, don't report an error if there is nonetools/perf/builtin-stat.c+4 -20 replies
6/7perf tests stat: Add test for error for an offline CPUtools/perf/tests/shell/stat.sh+27 -00 replies
7/7perf stat: Improve handling of termination by signaltools/perf/builtin-stat.c+16 -50 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchIngo MolnarThomas Richter
SeriesT-b T-b
1/7T-b
2/7T-b
3/7T-b
4/7T-b
5/7
6/7
7/7

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

Read the v2 thread

Cover letter [PATCH v2 0/7] Perf stat --null/offline CPU segv related fixes/tests

Ingo reported [1] that perf stat --null was segfaulting. Fix the underlying issue and add a test to the "perf stat tests". Do some related fixing/cleanup in the perf util cpumap code.

Thomas reported an issue fixed by the same patches [2] but caused by giving perf stat an offline CPU. Add test coverage for that and improve the "error" message that reports "success".

Ingo further pointed at broken signal handling in repeat mode [3]. I observed we weren't giving the best exit code, 0 rather than the expected 128+<signal number>. Add a patch fixing this.

[1] https://lore.kernel.org/linux-perf-users/[email protected]/
[2] https://lore.kernel.org/linux-perf-users/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/

Ian Rogers (7):
perf stat: Allow no events to open if this is a "--null" run libperf cpumap: Fix perf_cpu_map__max for an empty/NULL map perf cpumap: Add "any" CPU handling to cpu_map__snprint_mask perf tests stat: Add "--null" coverage
perf stat: When no events, don't report an error if there is none perf tests stat: Add test for error for an offline CPU perf stat: Improve handling of termination by signal

 tools/lib/perf/cpumap.c        | 10 +++++----
 tools/perf/builtin-stat.c      | 29 ++++++++++++++++++-------
 tools/perf/tests/shell/stat.sh | 39 ++++++++++++++++++++++++++++++++++
 tools/perf/util/cpumap.c       |  9 ++++++--
 4 files changed, 73 insertions(+), 14 deletions(-)
Signature · 1 line
2.52.0.177.g9f829587af-goog