Skip to content

Assume libbpf 1.0+

Ian Rogers bpf linux-perf-users lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 19 repliesIn review
  2. v13 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tools build: Pass libbpf feature only if libbpf 1.0+tools/build/feature/test-libbpf.c+4 -00 replies
2/3perf build: Remove libbpf pre-1.0 feature teststools/build/feature/Makefile tools/build/feature/test-libbpf-bpf_map_create.c tools/build/feature/test-libbpf-bpf_object__next_map.c +6 more+10 -1025 replies
3/3perf bpf: Remove pre libbpf 1.0 conditional logictools/perf/Makefile.config tools/perf/util/bpf-event.c tools/perf/util/bpf-loader.c +1 more+0 -1110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] Assume libbpf 1.0+

libbpf 1.0 was a major change in API. Perf has partially supported older libbpf's but an implementation may be:
..

       pr_err("%s: not support, update libbpf\n", __func__);
       return -ENOTSUP;

..

Rather than build a binary that would fail at runtime it is preferrential just to build libbpf statically and link against that. The static version is in the kernel tools tree and newer than 1.0.

These patches change the libbpf test to only pass when at least version 1.0 is installed, then remove the conditional build and feature logic.

The issue is discussed here:
https://lore.kernel.org/lkml/[email protected]/
perf bpf:

A variant of this fix was added to Linux 6.2 in:
"perf bpf: Avoid build breakage with libbpf < 0.8.0 + LIBBPF_DYNAMIC=1"
https://lore.kernel.org/lkml/[email protected]/
This change goes further in removing logic that is now no longer necessary.

v2. Rebase now that breakage fix patch is in linus/master.

Ian Rogers (3):
tools build: Pass libbpf feature only if libbpf 1.0+ perf build: Remove libbpf pre-1.0 feature tests perf bpf: Remove pre libbpf 1.0 conditional logic

 tools/build/feature/Makefile                  |  7 --
 .../feature/test-libbpf-bpf_map_create.c      |  8 ---
 .../test-libbpf-bpf_object__next_map.c        |  8 ---
 .../test-libbpf-bpf_object__next_program.c    |  8 ---
 .../build/feature/test-libbpf-bpf_prog_load.c |  9 ---
 .../test-libbpf-bpf_program__set_insns.c      |  8 ---
 .../test-libbpf-btf__load_from_kernel_by_id.c |  8 ---
 .../build/feature/test-libbpf-btf__raw_data.c |  8 ---
 tools/build/feature/test-libbpf.c             |  4 ++
 tools/perf/Makefile.config                    | 39 +----------
 tools/perf/util/bpf-event.c                   | 66 -------------------
 tools/perf/util/bpf-loader.c                  | 18 -----
 tools/perf/util/bpf_counter.c                 | 18 -----
 13 files changed, 5 insertions(+), 204 deletions(-)
 delete mode 100644 tools/build/feature/test-libbpf-bpf_map_create.c
 delete mode 100644 tools/build/feature/test-libbpf-bpf_object__next_map.c
 delete mode 100644 tools/build/feature/test-libbpf-bpf_object__next_program.c
 delete mode 100644 tools/build/feature/test-libbpf-bpf_prog_load.c
 delete mode 100644 tools/build/feature/test-libbpf-bpf_program__set_insns.c
 delete mode 100644 tools/build/feature/test-libbpf-btf__load_from_kernel_by_id.c
 delete mode 100644 tools/build/feature/test-libbpf-btf__raw_data.c
Signature · 1 line
2.39.0.314.g84b9a713c41-goog