aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/bpf-event.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/bpf-event.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/bpf-event.c')
-rw-r--r--tools/perf/util/bpf-event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index dc09a4730c50..664f361ef8c1 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -549,7 +549,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,
* for perf-record and perf-report use header.env;
* otherwise, use global perf_env.
*/
- env = session->data ? &session->header.env : &perf_env;
+ env = session->data ? perf_session__env(session) : &perf_env;
arrays = 1UL << PERF_BPIL_JITED_KSYMS;
arrays |= 1UL << PERF_BPIL_JITED_FUNC_LENS;