aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/tool.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2025-07-24 16:32:49 +0000
committerNamhyung Kim <[email protected]>2025-07-25 17:37:56 +0000
commitc3e5b9ec96dee864c2d6b00fbfe52e784f0d7bee (patch)
tree97bfe05652e699c9e314aeea01b661fb49750ab5 /tools/perf/util/tool.c
parentperf record: Make --buildid-mmap the default (diff)
downloadkernel-c3e5b9ec96dee864c2d6b00fbfe52e784f0d7bee.tar.gz
kernel-c3e5b9ec96dee864c2d6b00fbfe52e784f0d7bee.zip
perf session: Add accessor for session->header.env
The perf_env from the header in the session is frequently accessed, add an accessor function rather than access directly. Cache the value to avoid repeated calls. No behavioral change. Signed-off-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/tool.c')
-rw-r--r--tools/perf/util/tool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/tool.c b/tools/perf/util/tool.c
index 204ec03071bc..e83c7ababc2a 100644
--- a/tools/perf/util/tool.c
+++ b/tools/perf/util/tool.c
@@ -20,7 +20,7 @@ static int perf_session__process_compressed_event(struct perf_session *session,
void *src;
size_t decomp_size, src_size;
u64 decomp_last_rem = 0;
- size_t mmap_len, decomp_len = session->header.env.comp_mmap_len;
+ size_t mmap_len, decomp_len = perf_session__env(session)->comp_mmap_len;
struct decomp *decomp, *decomp_last = session->active_decomp->decomp_last;
if (decomp_last) {