Re: [PATCH v14 00/32] perf tools: Add evsel to perf_sample
From: Arnaldo Carvalho de Melo
Date: Wed May 20 2026 - 16:50:50 EST
On Wed, May 20, 2026 at 01:40:48PM -0700, Ian Rogers wrote:
> On Wed, May 20, 2026 at 12:46 PM Arnaldo Carvalho de Melo
> <acme@xxxxxxxxxx> wrote:
> >
> > On Wed, May 20, 2026 at 04:15:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Wed, May 20, 2026 at 12:05:06PM -0700, Ian Rogers wrote:
> > > > Nearly all perf code ends up passing an evsel with the perf_sample,
> > > > which is problematic if you want to rewrite the evsel (such as with
> > > > off-CPU processing) because all uses of the evsel need to be fixed
> > > > up. Since the perf_sample now carries its own resolved evsel pointer,
> > > > passing evsel separately is redundant and error-prone (allowing
> > > > parameter divergence bugs).
> > > >
> > > > This series cleans up the redundant evsel parameter across all perf
> > > > tool subcommands and APIs, ensuring that tools uniformly retrieve
> > > > event attributes directly from the sample itself. This simplifies
> > > > function signatures and improves API consistency.
> > > >
> > > > Additionally, this series incorporates subsequent memory safety
> > > > improvements, robust bounds checking, and memory leak corrections
> > > > prompted by address sanitizers and Sashiko code reviews.
> > > >
> > > > The original combined RFC patch:
> > > > https://lore.kernel.org/lkml/20260126071822.447368-1-irogers@xxxxxxxxxx/
> > > > was split up per reviewer requests.
> > > >
> > > > v14:
> > > > - Incorporate Acked-by tags from Namhyung Kim.
> > > > - Re-polish and expand commit descriptions to provide thorough explanations
> > > > of the changes and their rationale.
> > >
> > > Thanks, tentatively applying it to perf-tools-next, for v7.2.
> >
> > Had to apply a minor fixup for a conflict with anoter patch series from
> > you, the LBR one.
>
> Sorry for that and thanks for dealing with the conflict! Any chance
> you could push to tmp.perf-tools-next? I have some other series that
> will conflict and it would be nice to rebase those changes there.
I just removed the last two patches, the ones for kwork, as:
+ make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= NO_LIBELF=1 -C tools/perf O=/tmp/build/perf
make: Entering directory '/git/perf-7.1.0-rc2/tools/perf'
BUILD: Doing 'make -j32' parallel build
Makefile.config:647: Warning: Disabled BPF skeletons as libelf is required by bpftool
Makefile.config:745: Disabling post unwind, no support found.
Makefile.config:856: Missing python setuptools, the python binding won't be built, please install python3-setuptools or equivalent
Makefile.config:1045: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:1110: libpfm4 not found, disables libpfm4 support. Please install libpfm-devel or libpfm4-dev
Makefile.config:1135: Rust is not found. Test workloads with rust are disabled.
Auto-detecting system features:
... libdw: [ on ]
... glibc: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libpython: [ on ]
... libcapstone: [ on ]
... llvm-perf: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... libopenssl: [ on ]
... rust: [ OFF ]
CC /tmp/build/perf/dlfilters/dlfilter-test-api-v0.o
<SNIP>
LINK /tmp/build/perf/perf
/usr/bin/ld: /tmp/build/perf/perf-in.o: in function `work_pop_atom':
builtin-kwork.c:(.text+0x59c92): undefined reference to `work_exit'
/usr/bin/ld: /tmp/build/perf/perf-in.o: in function `work_push_atom.constprop.0':
builtin-kwork.c:(.text+0x5aba8): undefined reference to `work_exit'
/usr/bin/ld: /tmp/build/perf/perf-in.o: in function `cmd_kwork':
(.text+0x5bb4b): undefined reference to `work_exit'
/usr/bin/ld: (.text+0x5bbae): undefined reference to `work_exit'
/usr/bin/ld: (.text+0x5c3b2): undefined reference to `work_exit'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:586: /tmp/build/perf/perf] Error 1
make[1]: *** [Makefile.perf:289: sub-make] Error 2
make: *** [Makefile:76: all] Error 2
make: Leaving directory '/git/perf-7.1.0-rc2/tools/perf'
+ exit 1
toolsbuilder@five:~$
I'm doing some more tests, just a moment and I'll push what I have to
tmp.perf-tools-next.
- Arnaldo