Re: [PATCH v14 00/32] perf tools: Add evsel to perf_sample
From: Ian Rogers
Date: Wed May 20 2026 - 15:29:34 EST
On Wed, May 20, 2026 at 12:15 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> 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.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Thanks Arnaldo! There will be Sashiko reviews to come and the boundary
checking is likely to conflict with the boundary checking you are
adding in:
https://lore.kernel.org/linux-perf-users/20260510033424.255812-1-acme@xxxxxxxxxx/
When feedback arrives, I prefer sending additional fixes rather than
issuing a v15. I don't mind if you want to drop the boundary checks I
added, they were only included in the series to satisfy Sashiko and
because I worried we'd forget about them.
Thanks,
Ian