Re: [PATCH v14 00/32] perf tools: Add evsel to perf_sample

From: Arnaldo Carvalho de Melo

Date: Wed May 20 2026 - 15:15:46 EST


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>