All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	Mike Leach <mike.leach@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, peterz@infradead.org, mingo@redhat.com,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	namhyung@kernel.org
Subject: Re: [PATCH v3 1/2] perf build: Properly guard libbpf includes
Date: Tue, 10 Jan 2023 11:46:14 -0300	[thread overview]
Message-ID: <Y716Nt3c/Lc0Z4P5@kernel.org> (raw)
In-Reply-To: <Y712sCnYBJobe2eY@kernel.org>

Em Tue, Jan 10, 2023 at 11:31:12AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Jan 09, 2023 at 11:29:51AM -0800, Ian Rogers escreveu:
> > On Mon, Jan 9, 2023 at 10:37 AM Ian Rogers <irogers@google.com> wrote:
> > > -int libbpf_register_prog_handler(const char *sec __maybe_unused,
> > > -                                 enum bpf_prog_type prog_type __maybe_unused,
> > > -                                 enum bpf_attach_type exp_attach_type
> > > __maybe_unused,
> > > -                                 const struct
> > > libbpf_prog_handler_opts *opts __maybe_unused)
> > > +static int libbpf_register_prog_handler(const char *sec __maybe_unused,
> > > +                                       enum bpf_prog_type prog_type
> > > __maybe_unused,
> > > +                                       enum bpf_attach_type
> > > exp_attach_type __maybe_unused,
> > > +                                       const void *opts __maybe_unused)
> > > {
> > >        pr_err("%s: not support, update libbpf\n", __func__);
> > >        return -ENOTSUP;
> > > ```
> > >
> > > There are some other fixes necessary too. I'll try to write the fuller
> > > patch but I have no means for testing except for undefining
> > > HAVE_LIBBPF_BPF_PROGRAM__SET_INSNS.
> > 
> > So libbpf_prog_handler_opts is missing in the failing build, this
> > points to a libbpf before 0.8. I'm somewhat concerned that to work
> > around these linkage problems we're adding runtime errors - we may
> > build but the functionality is totally crippled. Is it worth
> > maintaining these broken builds or to just upfront fail the feature
> > test?
 
> Probably better to make the feature test disable bpf support while
> emitting a warning that features such as a, b, and c won't we available.

This would be the one-liner I think is appropriate for v6.2, ok?

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 9962ae23ab8c5868..5b87846759036f6f 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -589,6 +589,8 @@ ifndef NO_LIBELF
           $(call feature_check,libbpf-bpf_program__set_insns)
           ifeq ($(feature-libbpf-bpf_program__set_insns), 1)
             CFLAGS += -DHAVE_LIBBPF_BPF_PROGRAM__SET_INSNS
+          else
+            dummy := $(error Error: libbpf devel library needs to be >= 0.8.0 to build with LIBBPF_DYNAMIC, update or build statically with the version that comes with the kernel sources);
           endif
           $(call feature_check,libbpf-btf__raw_data)
           ifeq ($(feature-libbpf-btf__raw_data), 1)

  reply	other threads:[~2023-01-10 14:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 15:13 [PATCH v3 1/2] perf build: Properly guard libbpf includes Ian Rogers
2023-01-06 15:13 ` [PATCH v3 2/2] perf build: Fix build error when NO_LIBBPF=1 Ian Rogers
2023-01-06 15:28 ` [PATCH v3 1/2] perf build: Properly guard libbpf includes Mike Leach
2023-01-06 17:25   ` Arnaldo Carvalho de Melo
2023-01-06 17:53     ` Arnaldo Carvalho de Melo
2023-01-06 17:55       ` Arnaldo Carvalho de Melo
2023-01-06 19:06         ` Ian Rogers
2023-01-09 15:12           ` Arnaldo Carvalho de Melo
2023-01-09 18:10             ` Jiri Olsa
2023-01-09 18:37               ` Ian Rogers
2023-01-09 19:29                 ` Ian Rogers
2023-01-09 19:34                   ` Ian Rogers
2023-01-09 20:40                     ` Ian Rogers
2023-01-10 11:19                     ` Jiri Olsa
2023-01-10 13:35                       ` Arnaldo Carvalho de Melo
2023-01-10 13:39                         ` Jiri Olsa
2023-01-10 14:31                   ` Arnaldo Carvalho de Melo
2023-01-10 14:46                     ` Arnaldo Carvalho de Melo [this message]
2023-01-10 15:04                       ` [PATCH 1/1] perf bpf: Avoid build breakage with libbpf < 0.8.0 + LIBBPF_DYNAMIC=1 Arnaldo Carvalho de Melo
2023-01-10 20:00                       ` [PATCH v3 1/2] perf build: Properly guard libbpf includes Ian Rogers
2023-01-06 17:57       ` Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y716Nt3c/Lc0Z4P5@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.