summaryrefslogtreecommitdiff
path: root/tools/perf/tests/code-reading.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-07-24 09:32:56 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-07-25 10:37:57 -0700
commite481066388fe8003916461a54bf0ecffc02505a8 (patch)
treecb2e7115cde919a56cabc72ec6e8a3bb7e9fe700 /tools/perf/tests/code-reading.c
parentaa91baa09b2a3c38deff05b83410ce86833258d5 (diff)
perf machine: Explicitly pass in host perf_env
When creating a machine for the host explicitly pass in a scoped perf_env. This removes a use of the global perf_env. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250724163302.596743-17-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
-rw-r--r--tools/perf/tests/code-reading.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 0ec7004f90fe..9c2091310191 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -655,9 +655,8 @@ static int do_test_code_reading(bool try_kcore)
pid = getpid();
- machine = machine__new_host();
perf_env__init(&host_env);
- machine->env = &host_env;
+ machine = machine__new_host(&host_env);
ret = machine__create_kernel_maps(machine);
if (ret < 0) {