Re: [RFC PATCH] perf stat: Separate bperf from bpf_profiler

From: Arnaldo Carvalho de Melo
Date: Fri Apr 28 2023 - 21:44:43 EST


Em Fri, Apr 21, 2023 at 10:56:10PM +0200, Dmitry Dolgov escreveu:
> > On Wed, Apr 12, 2023 at 08:23:16PM +0200, Dmitrii Dolgov wrote:
> > It seems that perf stat -b <prog id> doesn't produce any results:
> >
> > $ perf stat -e cycles -b 4 -I 10000 -vvv
> > Control descriptor is not initialized
> > cycles: 0 0 0
> > time counts unit events
> > 10.007641640 <not supported> cycles
> >
> > Looks like this happens because fentry/fexit progs are getting loaded, but the
> > corresponding perf event is not enabled and not added into the events bpf map.
> > I think there is some mixing up between two type of bpf support, one for bperf
> > and one for bpf_profiler. Both are identified via evsel__is_bpf, based on which
> > perf events are enabled, but for the latter (bpf_profiler) a perf event is
> > required. Using evsel__is_bperf to check only bperf produces expected results:
>
> Any thoughts on this? I would appreciate clarifications if I'm missing
> something.

Namhyung, Song, can you please take a look at this?

- Arnaldo