Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h

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>

+6 -4
+1 -4
tools/perf/util/bpf-filter.c
··· 56 56 #include "util/debug.h" 57 57 #include "util/evsel.h" 58 58 #include "util/target.h" 59 + #include "util/bpf-utils.h" 59 60 60 61 #include "util/bpf-filter.h" 61 62 #include <util/bpf-filter-flex.h> ··· 443 442 free(pfi); 444 443 return -1; 445 444 } 446 - 447 - #define LIBBPF_CURRENT_VERSION_GEQ(major, minor) \ 448 - (LIBBPF_MAJOR_VERSION > (major) || \ 449 - (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor))) 450 445 451 446 int perf_bpf_filter__prepare(struct evsel *evsel, struct target *target) 452 447 {
+5
tools/perf/util/bpf-utils.h
··· 8 8 #ifdef HAVE_LIBBPF_SUPPORT 9 9 10 10 #include <bpf/libbpf.h> 11 + #include <bpf/libbpf_version.h> 12 + 13 + #define LIBBPF_CURRENT_VERSION_GEQ(major, minor) \ 14 + (LIBBPF_MAJOR_VERSION > (major) || \ 15 + (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor))) 11 16 12 17 /* 13 18 * Get bpf_prog_info in continuous memory