linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/11] Remove global perf_env
@ 2025-05-27  6:41 Ian Rogers
  2025-05-27  6:41 ` [PATCH v1 01/11] perf session: Add accessor for session->header.env Ian Rogers
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Ian Rogers @ 2025-05-27  6:41 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Kan Liang, John Garry, Will Deacon,
	James Clark, Mike Leach, Leo Yan, Charlie Jenkins, Colin Ian King,
	Andi Kleen, Dmitry Vyukov, Ravi Bangoria, Graham Woodward,
	Ilkka Koskinen, Zhongqiu Han, Yicong Yang, Howard Chu,
	Dr. David Alan Gilbert, Levi Yun, Weilin Wang, Michael Petlan,
	Krzysztof Łopatowski, Christophe Leroy,
	Masami Hiramatsu (Google), Chun-Tse Shao, Ben Gainey,
	linux-perf-users, linux-kernel, linux-arm-kernel

The global perf_env is used to hold host information, but it is also
used as a fallback in a number of cases where the information may be
bogus. Restructure the code so that the perf_env of the session is
accessed. When necessary a locally scoped host perf_env is created and
used.

Cleaning up the inconsistency was requested by Kan Liang in:
https://lore.kernel.org/lkml/c56c9e23-cf6e-4040-aee8-da13d5157dcf@linux.intel.com/

Ian Rogers (11):
  perf session: Add accessor for session->header.env
  perf session: Add an env pointer for the current perf_env
  perf evlist: Change env variable to session
  perf header: Clean up use of perf_env
  perf test: Avoid use perf_env
  perf top: Make perf_env locally scoped
  perf session: Add host_env argument to perf_session__new
  perf bench synthesize: Avoid use of global perf_env
  perf machine: Explicitly pass in host perf_env
  perf auxtrace: Pass perf_env from session through to mmap read
  perf env: Remove global perf_env

 tools/perf/bench/synthesize.c         |  30 +++--
 tools/perf/builtin-annotate.c         |   4 +-
 tools/perf/builtin-buildid-cache.c    |   2 +-
 tools/perf/builtin-buildid-list.c     |   5 +-
 tools/perf/builtin-c2c.c              |  16 ++-
 tools/perf/builtin-inject.c           |   5 +-
 tools/perf/builtin-kallsyms.c         |  21 ++-
 tools/perf/builtin-kmem.c             |   2 +-
 tools/perf/builtin-kvm.c              |   4 +-
 tools/perf/builtin-kwork.c            |   2 +-
 tools/perf/builtin-lock.c             |   4 +-
 tools/perf/builtin-mem.c              |   2 +-
 tools/perf/builtin-record.c           |  30 +++--
 tools/perf/builtin-report.c           |  14 +-
 tools/perf/builtin-sched.c            |   8 +-
 tools/perf/builtin-script.c           |  16 ++-
 tools/perf/builtin-stat.c             |  23 ++--
 tools/perf/builtin-timechart.c        |   2 +-
 tools/perf/builtin-top.c              |  40 ++++--
 tools/perf/builtin-trace.c            |  26 ++--
 tools/perf/perf.c                     |   3 -
 tools/perf/tests/code-reading.c       |   6 +-
 tools/perf/tests/dlfilter-test.c      |  51 ++++----
 tools/perf/tests/dwarf-unwind.c       |  10 +-
 tools/perf/tests/mmap-thread-lookup.c |   6 +-
 tools/perf/tests/symbols.c            |   8 +-
 tools/perf/tests/topology.c           |  39 +++---
 tools/perf/ui/browser.h               |   4 +-
 tools/perf/ui/browsers/header.c       |   4 +-
 tools/perf/ui/browsers/hists.c        |   2 +-
 tools/perf/util/amd-sample-raw.c      |   2 +-
 tools/perf/util/arm-spe.c             |   2 +-
 tools/perf/util/auxtrace.c            |  13 +-
 tools/perf/util/auxtrace.h            |   6 +-
 tools/perf/util/bpf-event.c           |   2 +-
 tools/perf/util/branch.c              |   2 +-
 tools/perf/util/data-convert-bt.c     |  16 +--
 tools/perf/util/data-convert-json.c   |  36 +++---
 tools/perf/util/env.c                 |   3 +-
 tools/perf/util/env.h                 |   2 -
 tools/perf/util/evlist.h              |   2 +-
 tools/perf/util/evsel.c               |  12 +-
 tools/perf/util/evsel.h               |   1 +
 tools/perf/util/header.c              | 180 +++++++++++++++-----------
 tools/perf/util/machine.c             |   8 +-
 tools/perf/util/machine.h             |   4 +-
 tools/perf/util/probe-event.c         |   5 +-
 tools/perf/util/s390-cpumsf.c         |   2 +-
 tools/perf/util/sample-raw.c          |   7 +-
 tools/perf/util/sample-raw.h          |   2 +-
 tools/perf/util/session.c             |  17 ++-
 tools/perf/util/session.h             |   9 +-
 tools/perf/util/tool.c                |   2 +-
 53 files changed, 424 insertions(+), 300 deletions(-)

-- 
2.49.0.1151.ga128411c76-goog


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

end of thread, other threads:[~2025-05-27  6:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27  6:41 [PATCH v1 00/11] Remove global perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 01/11] perf session: Add accessor for session->header.env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 02/11] perf session: Add an env pointer for the current perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 03/11] perf evlist: Change env variable to session Ian Rogers
2025-05-27  6:41 ` [PATCH v1 04/11] perf header: Clean up use of perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 05/11] perf test: Avoid use perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 06/11] perf top: Make perf_env locally scoped Ian Rogers
2025-05-27  6:41 ` [PATCH v1 07/11] perf session: Add host_env argument to perf_session__new Ian Rogers
2025-05-27  6:41 ` [PATCH v1 08/11] perf bench synthesize: Avoid use of global perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 09/11] perf machine: Explicitly pass in host perf_env Ian Rogers
2025-05-27  6:41 ` [PATCH v1 10/11] perf auxtrace: Pass perf_env from session through to mmap read Ian Rogers
2025-05-27  6:41 ` [PATCH v1 11/11] perf env: Remove global perf_env 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).