linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] Refactor perf cpumap
@ 2021-12-08  2:45 Ian Rogers
  2021-12-08  2:45 ` [PATCH 01/22] libperf: Add comments to perf_cpu_map Ian Rogers
                   ` (22 more replies)
  0 siblings, 23 replies; 40+ messages in thread
From: Ian Rogers @ 2021-12-08  2:45 UTC (permalink / raw)
  To: Andi Kleen, Jiri Olsa, Namhyung Kim, John Garry, Kajol Jain,
	Paul A . Clarke, Arnaldo Carvalho de Melo, Riccardo Mancini,
	Kan Liang, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, linux-perf-users, linux-kernel, Vineet Singh,
	James Clark, Mathieu Poirier, Suzuki K Poulose, Mike Leach,
	Leo Yan, coresight, linux-arm-kernel
  Cc: eranian, Ian Rogers

Perf cpu map has various functions where a cpumap and index are passed
in order to load the cpu. A problem with this is that the wrong index
may be passed for the cpumap, causing problems like aggregation on the
wrong CPU:
https://lore.kernel.org/lkml/20211204023409.969668-1-irogers@google.com/

This patch set refactors the cpu map API, greatly reducing it and
explicitly passing the cpu (rather than the pair) to functions that
need it. Comments are added at the same time.

Ian Rogers (22):
  libperf: Add comments to perf_cpu_map.
  perf stat: Add aggr creators that are passed a cpu.
  perf stat: Switch aggregation to use for_each loop
  perf stat: Switch to cpu version of cpu_map__get
  perf cpumap: Switch cpu_map__build_map to cpu function
  perf cpumap: Remove map+index get_socket
  perf cpumap: Remove map+index get_die
  perf cpumap: Remove map+index get_core
  perf cpumap: Remove map+index get_node
  perf cpumap: Add comments to aggr_cpu_id
  perf cpumap: Remove unused cpu_map__socket
  perf cpumap: Simplify equal function name.
  perf cpumap: Rename empty functions.
  perf cpumap: Document cpu__get_node and remove redundant function
  perf cpumap: Remove map from function names that don't use a map.
  perf cpumap: Remove cpu_map__cpu, use libperf function.
  perf cpumap: Refactor cpu_map__build_map
  perf cpumap: Rename cpu_map__get_X_aggr_by_cpu functions
  perf cpumap: Move 'has' function to libperf
  perf cpumap: Add some comments to cpu_aggr_map
  perf cpumap: Trim the cpu_aggr_map
  perf stat: Fix memory leak in check_per_pkg

 tools/lib/perf/cpumap.c                  |   7 +-
 tools/lib/perf/include/internal/cpumap.h |   9 +-
 tools/lib/perf/include/perf/cpumap.h     |   1 +
 tools/perf/arch/arm/util/cs-etm.c        |  16 +-
 tools/perf/builtin-ftrace.c              |   2 +-
 tools/perf/builtin-sched.c               |   6 +-
 tools/perf/builtin-stat.c                | 273 ++++++++++++-----------
 tools/perf/tests/topology.c              |  10 +-
 tools/perf/util/cpumap.c                 | 182 ++++++---------
 tools/perf/util/cpumap.h                 | 102 ++++++---
 tools/perf/util/cputopo.c                |   2 +-
 tools/perf/util/env.c                    |   6 +-
 tools/perf/util/stat-display.c           |  69 +++---
 tools/perf/util/stat.c                   |   9 +-
 tools/perf/util/stat.h                   |   3 +-
 15 files changed, 361 insertions(+), 336 deletions(-)

-- 
2.34.1.400.ga245620fadb-goog


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

end of thread, other threads:[~2021-12-13 22:06 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  2:45 [PATCH 00/22] Refactor perf cpumap Ian Rogers
2021-12-08  2:45 ` [PATCH 01/22] libperf: Add comments to perf_cpu_map Ian Rogers
2021-12-08 12:05   ` John Garry
2021-12-08 14:34     ` Ian Rogers
2021-12-08 15:09       ` Ian Rogers
2021-12-10 19:08       ` Arnaldo Carvalho de Melo
2021-12-13  8:56         ` John Garry
2021-12-08  2:45 ` [PATCH 02/22] perf stat: Add aggr creators that are passed a cpu Ian Rogers
2021-12-08 12:50   ` John Garry
2021-12-10 19:10   ` Arnaldo Carvalho de Melo
2021-12-08  2:45 ` [PATCH 03/22] perf stat: Switch aggregation to use for_each loop Ian Rogers
2021-12-11 19:24   ` Jiri Olsa
2021-12-13 16:17     ` Ian Rogers
2021-12-08  2:45 ` [PATCH 04/22] perf stat: Switch to cpu version of cpu_map__get Ian Rogers
2021-12-08  2:45 ` [PATCH 05/22] perf cpumap: Switch cpu_map__build_map to cpu function Ian Rogers
2021-12-08  2:45 ` [PATCH 06/22] perf cpumap: Remove map+index get_socket Ian Rogers
2021-12-11 19:25   ` Jiri Olsa
2021-12-08  2:45 ` [PATCH 07/22] perf cpumap: Remove map+index get_die Ian Rogers
2021-12-08  2:45 ` [PATCH 08/22] perf cpumap: Remove map+index get_core Ian Rogers
2021-12-08  2:45 ` [PATCH 09/22] perf cpumap: Remove map+index get_node Ian Rogers
2021-12-08  2:45 ` [PATCH 10/22] perf cpumap: Add comments to aggr_cpu_id Ian Rogers
2021-12-08  2:45 ` [PATCH 11/22] perf cpumap: Remove unused cpu_map__socket Ian Rogers
2021-12-08  2:45 ` [PATCH 12/22] perf cpumap: Simplify equal function name Ian Rogers
2021-12-08  2:45 ` [PATCH 13/22] perf cpumap: Rename empty functions Ian Rogers
2021-12-08  2:45 ` [PATCH 14/22] perf cpumap: Document cpu__get_node and remove redundant function Ian Rogers
2021-12-08  2:46 ` [PATCH 15/22] perf cpumap: Remove map from function names that don't use a map Ian Rogers
2021-12-08  2:46 ` [PATCH 16/22] perf cpumap: Remove cpu_map__cpu, use libperf function Ian Rogers
2021-12-08  2:46 ` [PATCH 17/22] perf cpumap: Refactor cpu_map__build_map Ian Rogers
2021-12-11 19:25   ` Jiri Olsa
2021-12-08  2:46 ` [PATCH 18/22] perf cpumap: Rename cpu_map__get_X_aggr_by_cpu functions Ian Rogers
2021-12-08  2:46 ` [PATCH 19/22] perf cpumap: Move 'has' function to libperf Ian Rogers
2021-12-08 17:59   ` Mathieu Poirier
2021-12-08  2:46 ` [PATCH 20/22] perf cpumap: Add some comments to cpu_aggr_map Ian Rogers
2021-12-08  2:46 ` [PATCH 21/22] perf cpumap: Trim the cpu_aggr_map Ian Rogers
2021-12-11 19:24   ` Jiri Olsa
2021-12-13 16:11     ` Ian Rogers
2021-12-08  2:46 ` [PATCH 22/22] perf stat: Fix memory leak in check_per_pkg Ian Rogers
2021-12-13 11:39 ` [PATCH 00/22] Refactor perf cpumap James Clark
2021-12-13 16:10   ` Ian Rogers
2021-12-13 22:06     ` Ian Rogers

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