Re: [PATCH 4/4] perf stat: Enable BPF counter with --for-each-cgroup
From: Namhyung Kim
Date: Thu Jul 01 2021 - 13:11:13 EST
On Thu, Jul 1, 2021 at 6:43 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> Em Wed, Jun 30, 2021 at 03:50:12PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Fri, Jun 25, 2021 at 12:18:26AM -0700, Namhyung Kim escreveu:
> > > Recently bperf was added to use BPF to count perf events for various
> > > purposes. This is an extension for the approach and targetting to
> > > cgroup usages.
> > >
> > > Unlike the other bperf, it doesn't share the events with other
> > > processes but it'd reduce unnecessary events (and the overhead of
> > > multiplexing) for each monitored cgroup within the perf session.
> > >
> > > When --for-each-cgroup is used with --bpf-counters, it will open
> > > cgroup-switches event per cpu internally and attach the new BPF
> > > program to read given perf_events and to aggregate the results for
> > > cgroups. It's only called when task is switched to a task in a
> > > different cgroup.
> > I'll take a stab at fixing these:
> So, tried some 'make -C tools clean', etc but I'm now stuck with:
> CLANG /tmp/build/perf/util/bpf_skel/.tmp/bperf_cgroup.bpf.o
> util/bpf_skel/bperf_cgroup.bpf.c:4:10: fatal error: 'vmlinux.h' file not found
> #include "vmlinux.h"
> 1 error generated.
> make: *** [Makefile.perf:1033: /tmp/build/perf/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1
> make: *** Waiting for unfinished jobs....
> CC /tmp/build/perf/pmu-events/pmu-events.o
> LD /tmp/build/perf/pmu-events/pmu-events-in.o
> Auto-detecting system features:
> ... libbfd: [ on ]
> ... disassembler-four-args: [ on ]
> ... zlib: [ on ]
> ... libcap: [ on ]
> ... clang-bpf-co-re: [ on ]
> MKDIR /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/
> MKDIR /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/libbpf/
> Have to go errands now, will put what I have at tmp.perf/core now.
> Please see if you can reproduce, I use this to build:
> make -k CORESIGHT=1 BUILD_BPF_SKEL=1 PYTHON=python3 DEBUG=1 O=/tmp/build/perf -C tools/perf install-bin
> - Arnaldo
Oh, sorry about that. I found the header generation is misplaced
in the Makefile.perf. Will fix it in the next version.