]> www.infradead.org Git - users/hch/misc.git/commitdiff
perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 19 Sep 2025 20:59:25 +0000 (17:59 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 30 Sep 2025 16:36:03 +0000 (13:36 -0300)
We need it to fix some other libbpf version dependent issues when
building with LIBBPF_DYNAMIC=1.

Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf-filter.c
tools/perf/util/bpf-utils.h

index 92308c38fbb567ba26bdb31f97c61ddd8d0682a5..1a2e7b388d57d3673321b92b5230e428e56fea5d 100644 (file)
@@ -56,6 +56,7 @@
 #include "util/debug.h"
 #include "util/evsel.h"
 #include "util/target.h"
+#include "util/bpf-utils.h"
 
 #include "util/bpf-filter.h"
 #include <util/bpf-filter-flex.h>
@@ -443,10 +444,6 @@ err:
        return -1;
 }
 
-#define LIBBPF_CURRENT_VERSION_GEQ(major, minor)                       \
-       (LIBBPF_MAJOR_VERSION > (major) ||                              \
-        (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor)))
-
 int perf_bpf_filter__prepare(struct evsel *evsel, struct target *target)
 {
        int i, x, y, fd, ret;
index 86a5055cdfad6689f4db9b1b818c0eae31b77fdf..eafc43b8731f1e31f7d0a6b05165acbe24f34f49 100644 (file)
@@ -8,6 +8,11 @@
 #ifdef HAVE_LIBBPF_SUPPORT
 
 #include <bpf/libbpf.h>
+#include <bpf/libbpf_version.h>
+
+#define LIBBPF_CURRENT_VERSION_GEQ(major, minor)                       \
+       (LIBBPF_MAJOR_VERSION > (major) ||                              \
+        (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor)))
 
 /*
  * Get bpf_prog_info in continuous memory