Skip to content

perf_counts clean up and perf stat report bug fix

Ian Rogers bpf linux-perf-users lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5perf stat: Fix and validate inputs in stat eventstools/perf/util/stat.c+14 -30 replies
2/5perf stat: Add stat record+report testtools/perf/tests/shell/stat.sh+13 -00 replies
3/5perf cpumap: Add perf_cpu_map__for_each_idxtools/lib/perf/include/perf/cpumap.h+3 -00 replies
4/5perf bpf_counter: Tidy use of CPU map indextools/perf/util/bpf_counter.c+35 -260 replies
5/5perf stat: Make use of index clearer with perf_countstools/perf/util/stat-display.c tools/perf/util/stat.c+16 -160 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/5] perf_counts clean up and perf stat report bug fix

perf_counts takes a CPU map index as an argument, however, there were a few places where this hadn't been cleaned up and the index was called cpu. In part this led to the bug discovered by Michael Petlan in:
https://lore.kernel.org/linux-perf-users/CAP-5=fWQR=sCuiSMktvUtcbOLidEpUJLCybVF6=BRvORcDOq+g@mail.gmail.com/

Fix the bug, tidy up more of the arguments passed to perf_counts, add a test to ensure the bug isn't reintroduced and add a helper macro to iterate over just CPU map indices.

Ian Rogers (5):
perf stat: Fix and validate inputs in stat events perf stat: Add stat record+report test
perf cpumap: Add perf_cpu_map__for_each_idx perf bpf_counter: Tidy use of CPU map index perf stat: Make use of index clearer with perf_counts

 tools/lib/perf/include/perf/cpumap.h |  3 ++
 tools/perf/tests/shell/stat.sh       | 13 ++++++
 tools/perf/util/bpf_counter.c        | 61 ++++++++++++++++------------
 tools/perf/util/stat-display.c       | 22 +++++-----
 tools/perf/util/stat.c               | 27 ++++++++----
 5 files changed, 81 insertions(+), 45 deletions(-)
Signature · 1 line
2.36.1.124.g0e6072fb45-goog