linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Building perf with BUILD_BPF_SKEL=1 by default
@ 2021-12-03 13:10 Arnaldo Carvalho de Melo
  2021-12-03 13:28 ` Arnaldo Carvalho de Melo
  2021-12-03 19:32 ` Song Liu
  0 siblings, 2 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-12-03 13:10 UTC (permalink / raw)
  To: Song Liu
  Cc: Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List, linux-perf-users

Hi Song,

	So I'm changing all my containers to build with BUILD_BPF_SKEL=1
to then make this the default, so far older containers fail either
because the clang available is too old, so I've added a NO_BUILD_BPF_SKEL=1
env var to disable that in those containers and then there is this other
case where clang is recent enough but:

    util/bpf_skel/bperf_leader.bpf.c:13:20: error: use of undeclared identifier 'BPF_F_PRESERVE_ELEMS'
            __uint(map_flags, BPF_F_PRESERVE_ELEMS);

Because the system's /usr/include/linux/bpf.h doesn't have that
BPF_F_PRESERVE_ELEMS enum entry.

These are enums to make them available via BTF, but then I can't use
the:

#ifdef BPF_F_PRESERVE_ELEMS
#define BPF_F_PRESERVE_ELEMS (1U << 11)
#endif

approach.

But then we _have_ it in the tools/include/uapi/linux/bpf.h we ship:

$ grep BPF_F_PRESERVE_ELEMS tools/include/uapi/linux/bpf.h
	BPF_F_PRESERVE_ELEMS	= (1U << 11),
$

so we need to switch to using it somehow, this way we can build in more
systems and make bperf and other BPF enabled features.

From a quick look I couldn't find where to add
$(sourcedir)/tools/include/uapi/ to the include path used to build
util/bpf_skel/bperf_leader.bpf.c, should be easy, can you take a look?

Thanks,

- Arnaldo

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

end of thread, other threads:[~2021-12-07  1:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 13:10 Building perf with BUILD_BPF_SKEL=1 by default Arnaldo Carvalho de Melo
2021-12-03 13:28 ` Arnaldo Carvalho de Melo
2021-12-03 14:23   ` Arnaldo Carvalho de Melo
2021-12-03 19:40     ` Song Liu
2021-12-03 20:05   ` Song Liu
2021-12-06 12:32     ` Arnaldo Carvalho de Melo
2021-12-06 17:08       ` Song Liu
2021-12-06 20:00         ` Arnaldo Carvalho de Melo
2021-12-06 22:34           ` Song Liu
2021-12-07  0:49             ` Arnaldo Carvalho de Melo
2021-12-07  1:07               ` Song Liu
2021-12-03 19:32 ` Song Liu
2021-12-05 13:06   ` Arnaldo Carvalho de Melo
2021-12-05 13:38     ` Arnaldo Carvalho de Melo
2021-12-06  3:47     ` Song Liu
2021-12-06 14:16   ` Athira Rajeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).