All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf build: Error for BPF skeletons without LIBBPF
@ 2022-05-20 21:18 Ian Rogers
  2022-05-23  9:12 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2022-05-20 21:18 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, linux-perf-users, linux-kernel, netdev, bpf
  Cc: Ian Rogers

LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1"
fails with compiler errors about missing declarations. Similar could
happen if libbpf feature detection fails. Prefer to error when
BUILD_BPF_SKEL is enabled but LIBBPF isn't.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index d9b699ad402c..bedb734bd6f2 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
   ifeq ($(feature-clang-bpf-co-re), 0)
     dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
   endif
+  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
+    dummy := $(error Error: BPF skeleton support requires libbpf)
+  endif
   $(call detected,CONFIG_PERF_BPF_SKEL)
   CFLAGS += -DHAVE_BPF_SKEL
 endif
-- 
2.36.1.124.g0e6072fb45-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf build: Error for BPF skeletons without LIBBPF
  2022-05-20 21:18 [PATCH] perf build: Error for BPF skeletons without LIBBPF Ian Rogers
@ 2022-05-23  9:12 ` Jiri Olsa
  2022-05-23 12:34   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2022-05-23  9:12 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Namhyung Kim,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, linux-perf-users, linux-kernel, netdev, bpf

On Fri, May 20, 2022 at 02:18:26PM -0700, Ian Rogers wrote:
> LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1"
> fails with compiler errors about missing declarations. Similar could
> happen if libbpf feature detection fails. Prefer to error when
> BUILD_BPF_SKEL is enabled but LIBBPF isn't.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

> ---
>  tools/perf/Makefile.config | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index d9b699ad402c..bedb734bd6f2 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
>    ifeq ($(feature-clang-bpf-co-re), 0)
>      dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
>    endif
> +  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
> +    dummy := $(error Error: BPF skeleton support requires libbpf)
> +  endif
>    $(call detected,CONFIG_PERF_BPF_SKEL)
>    CFLAGS += -DHAVE_BPF_SKEL
>  endif
> -- 
> 2.36.1.124.g0e6072fb45-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf build: Error for BPF skeletons without LIBBPF
  2022-05-23  9:12 ` Jiri Olsa
@ 2022-05-23 12:34   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-05-23 12:34 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, linux-perf-users,
	linux-kernel, netdev, bpf

Em Mon, May 23, 2022 at 11:12:16AM +0200, Jiri Olsa escreveu:
> On Fri, May 20, 2022 at 02:18:26PM -0700, Ian Rogers wrote:
> > LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1"
> > fails with compiler errors about missing declarations. Similar could
> > happen if libbpf feature detection fails. Prefer to error when
> > BUILD_BPF_SKEL is enabled but LIBBPF isn't.
> > 
> > Signed-off-by: Ian Rogers <irogers@google.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied.

- Arnaldo

 
> thanks,
> jirka
> 
> > ---
> >  tools/perf/Makefile.config | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> > index d9b699ad402c..bedb734bd6f2 100644
> > --- a/tools/perf/Makefile.config
> > +++ b/tools/perf/Makefile.config
> > @@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
> >    ifeq ($(feature-clang-bpf-co-re), 0)
> >      dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
> >    endif
> > +  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
> > +    dummy := $(error Error: BPF skeleton support requires libbpf)
> > +  endif
> >    $(call detected,CONFIG_PERF_BPF_SKEL)
> >    CFLAGS += -DHAVE_BPF_SKEL
> >  endif
> > -- 
> > 2.36.1.124.g0e6072fb45-goog
> > 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-23 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 21:18 [PATCH] perf build: Error for BPF skeletons without LIBBPF Ian Rogers
2022-05-23  9:12 ` Jiri Olsa
2022-05-23 12:34   ` Arnaldo Carvalho de Melo

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.