]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf sample: Add file_offset field to struct perf_sample
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 1 Jun 2026 16:07:52 +0000 (13:07 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Jun 2026 19:31:03 +0000 (16:31 -0300)
commit7a490187f22b4bfae7ef752edbe3fb13017ca11c
tree24a439085a0c8338706641bb1bb1e3155943943e
parentbb4832101b0969d7d3faf7dd6095274db288cd0f
perf sample: Add file_offset field to struct perf_sample

Add a file_offset field to struct perf_sample so that event processing
callbacks can report the byte offset of the problematic event in
perf.data, letting users cross-reference with 'perf report -D' output.

Set sample.file_offset in perf_session__deliver_event(), which is the
common entry point for both file mode (mmap'd offset) and pipe mode
(running byte counter from __perf_session__process_pipe_events).

The assignment is placed after evsel__parse_sample(), which zeroes
the struct via memset.

Preserve file_offset through the deferred callchain delivery path by
storing it in struct deferred_event and restoring it after
evlist__parse_sample() in both evlist__deliver_deferred_callchain()
and session__flush_deferred_samples().

Subsequent patches will use this field in skip/stop warning messages.

Reviewed-by: Ian Rogers <irogers@google.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/sample.h
tools/perf/util/session.c