Re: [PATCH v4 48/48] perf cpumap: Give CPUs their own type.
From: Arnaldo Carvalho de Melo
Date: Tue Jan 11 2022 - 15:47:18 EST
Em Tue, Jan 11, 2022 at 05:01:10PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Jan 11, 2022 at 11:16:16AM -0800, Ian Rogers escreveu:
> > On Mon, Jan 10, 2022 at 11:50 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > > Em Tue, Jan 04, 2022 at 10:13:51PM -0800, Ian Rogers escreveu:
> > > > A common problem is confusing CPU map indices with the CPU, by wrapping
> > > > the CPU with a struct then this is avoided. This approach is similar to
> > > > atomic_t.
> > >
> > > This one needed this to build with BUILD_BPF_SKEL=1, please check, I'll
> > > soon push this to tmp.perf/perf_cpu so that you can take a look and test
> > > it.
> > Thanks Arnaldo, I did eye-ball one issue where cpu_map__default_new's
> > behavior would be impacted (nr would be 1 rather than nr_cpus). The
> > fix is:
> >
> > --- a/tools/lib/perf/cpumap.c
> > +++ b/tools/lib/perf/cpumap.c
> > @@ -18,7 +18,7 @@ static struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus)
> > if (!cpus)
> > return NULL;
> >
> > - cpus->nr = 1;
> > + cpus->nr = nr_cpus;
> > refcount_set(&cpus->refcnt, 1);
> > return cpus;
> > }
>
> > Could you add that into this patch as well?
>
> Sure.
>
> I´m now running perf-test after each of those csets, so far so good.
This is what I'm running now after doing a 'git rebase -i
start-of-your-patchkit' with all set to 'edit'.
Will take a while :-)
# cat ~/bin/perf-test-build
#!/bin/bash
while true ; do
rm -rf /tmp/build/perf ; sudo -u acme mkdir /tmp/build/perf
sudo -u acme make -k BUILD_BPF_SKEL=1 PYTHON=python3 O=/tmp/build/perf -C tools/perf install-bin || exit 1
cd ..
perf test || exit 2
cd -
sudo -u acme git rebase --continue || exit 0
done
- Arnaldo