perf trace: Avoid global perf_env with evsel__env
authorIan Rogers <irogers@google.com>
Thu, 24 Jul 2025 16:32:58 +0000 (09:32 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 25 Jul 2025 17:37:58 +0000 (10:37 -0700)
commit003a86bce0728ad160bcb7c7566a4d40aee3c235
tree365b05f093bbe12c6f649609551a4df9bfa72e5d
parent69ac7472d28a21057275a396193f1bdcce6ba962
perf trace: Avoid global perf_env with evsel__env

There is no session in perf trace unless in replay mode, so in host
mode no session can be associated with the evlist. If the evsel__env
call fails resort to the host_env that's part of the trace. Remove
errno_to_name as it becomes a called once 1-line function once the
argument is turned into a perf_env, just call perf_env__arch_strerrno
directly.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250724163302.596743-19-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c