Re: [PATCH] perf tools: Skip BPF sideband event for userspace profiling

From: Namhyung Kim
Date: Wed Feb 26 2025 - 17:20:27 EST


Hello,

On Wed, Feb 26, 2025 at 02:00:36PM -0800, Song Liu wrote:
> On Wed, Feb 26, 2025 at 12:59 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> >
> > On Wed, Feb 26, 2025 at 12:30 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > >
> > > The BPF sideband information is tracked using a separate thread and
> > > evlist. But it's only useful for profiling kernel and we can skip it
> > > when users profile their application only.
> >
> > nit: It may be worth noting that profiling an application implicitly
> > excludes the kernel samples.
> >
> > > It seems it already fails to open the sideband event in that case.
> > > Let's remove the noise in the verbose output anyway.
> > >
> > > Cc: Song Liu <song@xxxxxxxxxx>
> > > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> >
> > Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks for your review!

> >
> > I wonder if the second evlist could be avoided similar to Howard's
> > off-CPU sample events?
> > I also wonder if we should make the evlist responsible for BPF and
> > dummy/sideband events. Having unnecessary events increases the list
> > size iterated over when creating sideband data, and so has a runtime
> > cost. Having the logic separated in places like builtin-top and
> > builtin-record feels suboptimal.
>
> It appears we can indeed put this logic in evlist.

Ok, I'll give it a spin.

Thanks,
Namhyung