[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fVAhoqE6E87FRnwHr6Em2eX9Rq++6HmHMcFqVjFGCitmA@mail.gmail.com>
Date: Mon, 13 Mar 2023 18:51:01 -0700
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Andres Freund <andres@...razel.de>,
Quentin Monnet <quentin@...valent.com>,
Roberto Sassu <roberto.sassu@...wei.com>,
Christy Lee <christylee@...com>,
Andrii Nakryiko <andrii@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH v2 2/3] perf build: Remove libbpf pre-1.0 feature tests
On Mon, Mar 13, 2023 at 5:19 PM Ian Rogers <irogers@...gle.com> wrote:
>
> On Mon, Mar 13, 2023 at 2:38 PM Arnaldo Carvalho de Melo
> <acme@...nel.org> wrote:
> >
> > Em Mon, Mar 13, 2023 at 06:10:40PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Sun, Jan 15, 2023 at 05:01:14PM -0800, Ian Rogers escreveu:
> > > > The feature tests were necessary for libbpf pre-1.0, but as the libbpf
> > > > implies at least 1.0 we can remove these now.
> > >
> > > So I added this:
> > >
> > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> > > index 8b0bd3aa018ef166..b715cd4f43f4a014 100644
> > > --- a/tools/perf/Makefile.config
> > > +++ b/tools/perf/Makefile.config
> > > @@ -580,7 +580,7 @@ ifndef NO_LIBELF
> > > EXTLIBS += -lbpf
> > > $(call detected,CONFIG_LIBBPF_DYNAMIC)
> > > else
> > > - dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
> > > + dummy := $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel);
> > > endif
> > > else
> > > # Libbpf will be built as a static library from tools/lib/bpf.
> > >
> > > To better reflect the failure reason:
> > >
> > > ⬢[acme@...lbox perf-tools-next]$ cat /tmp/build/perf-tools-next/feature/test-libbpf.make.output
> > > test-libbpf.c:5:2: error: #error At least libbpf 1.0 is required for Linux tools.
> > > 5 | #error At least libbpf 1.0 is required for Linux tools.
> > > | ^~~~~
> > > ⬢[acme@...lbox perf-tools-next]$ rpm -q libbpf-devel
> > > libbpf-devel-0.8.0-2.fc37.x86_64
> > > ⬢[acme@...lbox perf-tools-next]$
> > >
> > > I'll see if I can make the build test conditional on libbpf being >= 1.0
> >
> > I'm trying with this:
> >
> > ⬢[acme@...lbox libbpf]$ git log --oneline -1 9476dce6fe905a6bf1d4c483f7b2b8575c4ffb2d
> > 9476dce6fe905a6b libbpf: remove deprecated low-level APIs
> > ⬢[acme@...lbox libbpf]$ git tag --contains 9476dce6fe905a6bf1d4c483f7b2b8575c4ffb2d
> > v1.0.0
> > v1.0.1
> > v1.1.0
> > ⬢[acme@...lbox libbpf]$
> >
> > diff --git a/tools/perf/tests/make b/tools/perf/tests/make
> > index 531324c3dab594e1..f866c58b916f4d7a 100644
> > --- a/tools/perf/tests/make
> > +++ b/tools/perf/tests/make
> > @@ -63,6 +63,7 @@ endif
> >
> > has = $(shell which $1 2>/dev/null)
> > python_perf_so := $(shell $(MAKE) python_perf_target|grep "Target is:"|awk '{print $$3}')
> > +old_libbpf := $(shell grep -q LIBBPF_DEPRECATED /usr/include/bpf/bpf.h)
>
> I think this could also be:
> old_libbpf := $(shell grep MAJOR /usr/include/bpf/libbpf_version.h
> 2>&1 |grep -q 0)
> Which may be a bit more intention revealing and future proof.
>
> Thanks,
> Ian
To avoid /usr/include assumptions, there's also:
old_libbpf := $(shell echo "#include <bpf/libbpf.h>" | $(CC) -E -dM -x
c -|grep "define LIBBPF_MAJOR_VERSION"|grep -q 0)
:-)
Ian
> > # standard single make variable specified
> > make_clean_all := clean all
> > @@ -151,7 +152,9 @@ run += make_no_libaudit
> > run += make_no_libbionic
> > run += make_no_auxtrace
> > run += make_no_libbpf
> > +ifneq ($(old_libbpf),)
> > run += make_libbpf_dynamic
> > +endif
> > run += make_no_libbpf_DEBUG
> > run += make_no_libcrypto
> > run += make_no_sdt
Powered by blists - more mailing lists