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

perf bpf-event: Use libbpf version rather than feature check

The feature check guarded the -DHAVE_LIBBPF_STRINGS_SUPPORT is
unnecessary as it is sufficient and easier to use the
LIBBPF_CURRENT_VERSION_GEQ macro.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Blake Jones <blakejones@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
2bd59717 a90777bb

+6 -9
-7
tools/perf/Makefile.config
··· 596 596 LIBBPF_INCLUDE = $(LIBBPF_DIR)/.. 597 597 endif 598 598 endif 599 - 600 - FEATURE_CHECK_CFLAGS-libbpf-strings="-I$(LIBBPF_INCLUDE)" 601 - $(call feature_check,libbpf-strings) 602 - ifeq ($(feature-libbpf-strings), 1) 603 - $(call detected,CONFIG_LIBBPF_STRINGS) 604 - CFLAGS += -DHAVE_LIBBPF_STRINGS_SUPPORT 605 - endif 606 599 endif 607 600 endif # NO_LIBBPF 608 601 endif # NO_LIBELF
+1
tools/perf/builtin-check.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "builtin.h" 3 3 #include "color.h" 4 + #include "util/bpf-utils.h" 4 5 #include "util/debug.h" 5 6 #include "util/header.h" 6 7 #include <tools/config.h>
-2
tools/perf/util/bpf-event.c
··· 288 288 .sz = sizeof(struct btf_dump_type_data_opts), 289 289 .skip_names = 1, 290 290 .compact = 1, 291 - #if LIBBPF_CURRENT_VERSION_GEQ(1, 7) 292 291 .emit_strings = 1, 293 - #endif 294 292 }; 295 293 struct btf_dump *d; 296 294 size_t btf_size;
+5
tools/perf/util/bpf-utils.h
··· 14 14 (LIBBPF_MAJOR_VERSION > (major) || \ 15 15 (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor))) 16 16 17 + #if LIBBPF_CURRENT_VERSION_GEQ(1, 7) 18 + // libbpf 1.7+ support the btf_dump_type_data_opts.emit_strings option. 19 + #define HAVE_LIBBPF_STRINGS_SUPPORT 1 20 + #endif 21 + 17 22 /* 18 23 * Get bpf_prog_info in continuous memory 19 24 *