netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] perf_counts clean up and perf stat report bug fix
@ 2022-05-19  3:20 Ian Rogers
  2022-05-19  3:20 ` [PATCH 1/5] perf stat: Fix and validate inputs in stat events Ian Rogers
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ian Rogers @ 2022-05-19  3:20 UTC (permalink / raw)
  To: Michael Petlan, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, James Clark, Kan Liang, Quentin Monnet,
	Dave Marchevsky, Zhengjun Xing, Lv Ruyi, linux-perf-users,
	linux-kernel, netdev, bpf
  Cc: Stephane Eranian, Ian Rogers

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(-)

-- 
2.36.1.124.g0e6072fb45-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-23 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19  3:20 [PATCH 0/5] perf_counts clean up and perf stat report bug fix Ian Rogers
2022-05-19  3:20 ` [PATCH 1/5] perf stat: Fix and validate inputs in stat events Ian Rogers
2022-05-19  3:20 ` [PATCH 2/5] perf stat: Add stat record+report test Ian Rogers
2022-05-19  3:20 ` [PATCH 3/5] perf cpumap: Add perf_cpu_map__for_each_idx Ian Rogers
2022-05-19  3:20 ` [PATCH 4/5] perf bpf_counter: Tidy use of CPU map index Ian Rogers
2022-05-19  3:20 ` [PATCH 5/5] perf stat: Make use of index clearer with perf_counts Ian Rogers
2022-05-23 12:54 ` [PATCH 0/5] perf_counts clean up and perf stat report bug fix Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).