[RFC PATCH v1] perf sample: Add evsel to sample and avoid passing as a pair

Ian Rogers irogers at google.com
Mon Jan 26 09:20:33 PST 2026


On Mon, Jan 26, 2026 at 1:04 AM Mi, Dapeng <dapeng1.mi at linux.intel.com> wrote:
>
>
> On 1/26/2026 3:18 PM, Ian Rogers wrote:
> > The perf_sample and evsel are typically passed as a pair. This creates
> > 2 arguments for the price of 1. It is also inconvenient if you wish to
> > rewrite a sample, as the evsel will need updating in all cases,
> > something similar to this currently happens for off-cpu output. Avoid
> > passing the evsel by adding it into the sample. So that two evsels
> > aren't being passed around, fix up functions taking a sample and an
> > evsel argument to only take a sample, the evsel now being able to be
> > read from the sample.
> >
> > Signed-off-by: Ian Rogers <irogers at google.com>
> > ---
> > This is a fairly large and invasive change but doing something some
> > what mundane. Sending out as an RFC for early feedback.
>
> Nice cleanup. Better split this huge patch into several patches in the
> formal patch-set. Thanks.

Having several patches means having intermediate states where there
are 2 evsels (a parameter and one in the sample). Getting things
building with lots of intermediate states is one thing, having things
work and not break tests is another. I'll see what can be done, but it
was somewhat deliberate not to have intermediate broken states with
the albeit large patch.

Thanks,
Ian



More information about the linux-riscv mailing list