From: Ian Rogers Date: Mon, 18 May 2026 15:46:33 +0000 (-0700) Subject: perf build: Remove redundant libbpf feature check for static builds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29331b2edb861e1a7e2fadc8d06403c460eb6064;p=thirdparty%2Fkernel%2Fstable.git perf build: Remove redundant libbpf feature check for static builds By default, the perf tool compiles and statically links against its own internal copy of libbpf (tools/lib/bpf/libbpf.a), setting LIBBPF_STATIC=1. Despite this static linkage, Makefile.config unconditionally executed $(call feature_check,libbpf), which forced a synchronous sub-make fork during AST parsing to detect dynamic system libbpf libraries. As noted in the internal Makefile comments, this check was executed purely so that running `make VF=1` would display the detection status of system libbpf. During standard builds without LIBBPF_DYNAMIC=1, the detection result was entirely ignored. Wrap the libbpf feature check inside LIBBPF_DYNAMIC=1 so Make avoids the redundant sub-make fork overhead during standard static builds. Reviewed-by: Namhyung Kim Assisted-by: Gemini:gemini-3.1-pro-preview Signed-off-by: Ian Rogers Tested-by: James Clark Cc: Adrian Hunter Cc: Albert Ou Cc: Alexandre Chartre Cc: Alexandre Ghiti Cc: Andrii Nakryiko Cc: Ankur Arora Cc: Collin Funk Cc: Costa Shulyupin Cc: Daniel Borkmann Cc: Dapeng Mi Cc: David Sterba Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Eduard Zingerman Cc: Howard Chu Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kumar Kartikeya Dwivedi Cc: Leo Yan Cc: Markus Mayer Cc: Martin KaFai Lau Cc: Nathan Chancellor Cc: Nick Terrell Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ricky Ringler Cc: Song Liu Cc: Swapnil Sapkal Cc: Thomas Falcon Cc: Tomas Glozar Cc: Yonghong Song Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 8437c3f72125..26de7528d6ce 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -575,10 +575,8 @@ ifndef NO_LIBELF ifndef NO_LIBBPF ifeq ($(feature-bpf), 1) - # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status - $(call feature_check,libbpf) - ifdef LIBBPF_DYNAMIC + $(call feature_check,libbpf) ifeq ($(feature-libbpf), 1) EXTLIBS += -lbpf CFLAGS += -DHAVE_LIBBPF_SUPPORT