From nobody Sat Oct 24 13:20:03 2026 Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25C96552945 for ; Tue, 13 Oct 2026 22:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791929817; cv=none; b=cfFHVg+S78l9Lw3ZUqLrlh9aZZTChZfWB13prbXdRnLJK+zjtfpUeCaSiVDoy/ezPZ4Eznapy9tR6c0aAs/9EKdMMAJmEVyi1KIXcGKiHJo3FIrs7xlw0v43ejrT3ESZl1ANhpphfoOKOPJg3uOsVxL7qqX1vT/NRacSST3vCbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791929817; c=relaxed/simple; bh=Le3RIdFDWzXr3CmRn/RyvEvO1U2K+C02J6LcVuBqvtw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gEsNV2jYyq1ZmGpTahQUISvoyEyhMt3tIH5QRvN5UC5Fi7CpqWd7MaAT4OgUOCx8jMABSLweB48AQwMhy8vYBW7dAW6XqSVXOhT0a47SHjP2sKGVGBDxfHakv9tnHS0usSP6nh2S4hgjp3/dnoTZ6zPFH+2bU5khzAs5NdIJgHA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gCxXkrVT; arc=none smtp.client-ip=74.125.82.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gCxXkrVT" Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-139b62317d0so13865839c88.0 for ; Tue, 13 Oct 2026 15:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1791929814; x=1792534614; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3YXXmBiMIQ/pkFW8VDRpK9ExuImLnICRP/QM6dS80OU=; b=gCxXkrVTVlzivLHhR2oHHBycw39eYrxg6YW5aebYbzhYtODv55+J4T6PWX1CiICho/ OlBKrZOHvX/vDiNdbZERFQ+StW6kXWTkAxOe0e8dIZD36n31wgTzIrUnf/zeCtyVnMSa p+3AYblBJ5ynPJRELVpIzlt/arjPny0YyhYclOZYzSveN1XMygYDslS8+DlCMlrnCU0t w4FcY6f4e6j9FYShPEKHzYOp/z+UWtigRW/5/MTrQonQeMDP8NTRdYADyfTXomegWbQb 4OKqLmCRsb9eOFO41dN3hwUKBuNfnYtAlQXorlsQGn5VgmbOdPpc8nOhznvKdwe8RVDu uRzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791929814; x=1792534614; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3YXXmBiMIQ/pkFW8VDRpK9ExuImLnICRP/QM6dS80OU=; b=rFZH0JzBpDfQGpGCb/nnFyNS+nneeFE4l96OupqOo0h3X6RKmo3jZaz5Akz+ypGKvy E5k0yRUvQ+lAeWLe5exg0Lr/y1fH58vruBoPjmLVZUcrxyuU4VZe+8tLUflSEQgvMqNU SS1CyDnTvcsaTvoFNHhjEHCuKEXW4fxlTHFRFpH+tuqCh5AI++qQ1BJTgHmNNJJs6VrD Ct3O0x2n8diCxhEZ3LFTeNIXIiVqyu4Ex07NG2UhA5XkdG4CT4kstYYkR/662YuR+WaY aUDCGeW529owMLmVxpR55HnddxkDf8bjfW5+g9aUt8zTLqaUwF7niSOUKIzj763p/BGE C0gA== X-Forwarded-Encrypted: i=1; AKwUvBxviuRgWtf7qGzOM1+k0d1ow5zDW88LStfclwLOL821WoVmlobyFMyPHej1RQI6BNtYCnahoHifYje2HqA=@vger.kernel.org X-Gm-Message-State: AFq9FYL6T3ZjHG84WJqQpkUVdm2nf+wEBiGLMhI5UzgEp7sVX0c9ANh9 8npT1zlKkjU7fbc8Ukv5CnMdtk/Srs6r8bwgYWXjIyBaBODn/wChuDqElGWb+gfJjh0iOuHLHTW peoBZTnGU+w== X-Received: from dyad4.prod.google.com ([2002:a05:693c:8344:b0:351:7ff8:2656]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:ea86:b0:153:7a27:b7d with SMTP id a92af1059eb24-16a626f6e93mr17582035c88.20.1791929813756; Tue, 13 Oct 2026 15:16:53 -0700 (PDT) Date: Tue, 13 Oct 2026 15:16:42 -0700 In-Reply-To: <20261013221643.1815686-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20261013221643.1815686-1-irogers@google.com> X-Mailer: git-send-email 2.56.0.385.gd3acb90ef8-goog Message-ID: <20261013221643.1815686-2-irogers@google.com> Subject: [PATCH v1 1/2] perf build: Support building BPF skeletons with bpf-gcc From: Ian Rogers To: Arnaldo Carvalho de Melo , Namhyung Kim , "Jose E . Marchesi" , David Faust , Cupertino Miranda Cc: Peter Zijlstra , Ingo Molnar , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Andrii Nakryiko , Eduard Zingerman , Yonghong Song , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Support building perf BPF skeletons with bpf-gcc (>=3D 14.0.0) in addition to clang (>=3D 12.0.1), similar to tools/testing/selftests/bpf/Makefile. When building perf with GCC (CC_NO_CLANG=3D1), prefer bpf-gcc and fall back to clang if bpf-gcc is unavailable or too old. When building with Clang/LLVM (CC_NO_CLANG=3D0), prefer clang and fall back to bpf-gcc. Explicit command-line overrides via BPF_GCC=3D... or CLANG=3D... are respected, and setting BPF_GCC=3D or CLANG=3D to empty disables that compiler. In bpf_skel.mak, pass the bpf-gcc flags (-mcpu=3Dv3, -fno-ident, -DBPF_NO_PRESERVE_ACCESS_INDEX, -Wno-attributes, -D__TARGET_ARCH_$(SRCARCH), and target endianness) and query system include paths from $(CC). Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 81 +++++++++++++++++++++++++++------- tools/perf/Makefile.perf | 8 +++- tools/perf/bpf_skel.mak | 36 ++++++++++----- tools/scripts/Makefile.include | 1 + 4 files changed, 97 insertions(+), 29 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index cafc7be79643..6aee2665b64c 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -662,27 +662,76 @@ ifeq ($(BUILD_BPF_SKEL),1) else ifeq ($(filter -DHAVE_LIBOPENSSL_SUPPORT, $(CFLAGS)),) $(warning Warning: Disabled BPF skeletons as libopenssl is required) BUILD_BPF_SKEL :=3D 0 - else ifeq ($(call get-executable,$(CLANG)),) - $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) is missi= ng) - BUILD_BPF_SKEL :=3D 0 - else - CLANG_VERSION :=3D $(shell $(CLANG) --version | head -1 | sed 's/.*cla= ng version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') - ifeq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1) - $(warning Warning: Disabled BPF skeletons as reliable BTF generation= needs at least $(CLANG) version 12.0.1) - BUILD_BPF_SKEL :=3D 0 - endif endif ifeq ($(BUILD_BPF_SKEL),1) - $(call feature_check,clang-bpf-co-re) - ifeq ($(feature-clang-bpf-co-re), 0) - $(warning Warning: Disabled BPF skeletons as clang is too old) + # Prefer bpf-gcc when building with gcc (CC_NO_CLANG=3D1) and clang wh= en + # building with clang, unless CLANG or BPF_GCC was explicitly specifie= d on + # the command line. Fall back to whichever compiler is available. + prefer_bpf_gcc :=3D $(CC_NO_CLANG) + ifeq ($(origin BPF_GCC),command line) + ifneq ($(BPF_GCC),) + prefer_bpf_gcc :=3D 1 + endif + else ifeq ($(origin CLANG),command line) + ifneq ($(CLANG),) + prefer_bpf_gcc :=3D 0 + endif + endif + + have_bpf_gcc :=3D 0 + have_clang_bpf :=3D 0 + + define check_bpf_gcc + ifneq ($$(call get-executable,$$(BPF_GCC)),) + BPF_GCC_VERSION :=3D $$(shell $$(BPF_GCC) -dumpfullversion -dumpve= rsion 2>/dev/null) + ifneq ($$(call version-lt3,$$(BPF_GCC_VERSION),14.0.0),1) + have_bpf_gcc :=3D 1 + endif + endif + endef + + ifeq ($(prefer_bpf_gcc),1) + $(eval $(check_bpf_gcc)) + endif + + ifeq ($(have_bpf_gcc),0) + ifneq ($(call get-executable,$(CLANG)),) + CLANG_VERSION :=3D $(shell $(CLANG) --version | head -1 | sed 's/.= *clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') + ifneq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1) + $(call feature_check,clang-bpf-co-re) + ifeq ($(feature-clang-bpf-co-re), 1) + have_clang_bpf :=3D 1 + endif + endif + endif + endif + + ifeq ($(prefer_bpf_gcc)$(have_clang_bpf),00) + $(eval $(check_bpf_gcc)) + endif + + ifeq ($(have_bpf_gcc),1) + $(call detected,CONFIG_PERF_BPF_SKEL_BPF_GCC) + $(call detected,CONFIG_PERF_BPF_SKEL) + CFLAGS +=3D -DHAVE_BPF_SKEL + else ifeq ($(have_clang_bpf),1) + $(call detected,CONFIG_PERF_BPF_SKEL) + CFLAGS +=3D -DHAVE_BPF_SKEL + else + ifeq ($(call get-executable,$(CLANG))$(call get-executable,$(BPF_GCC= )),) + $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) and = bpf-gcc ($(BPF_GCC)) are missing) + else ifneq ($(call get-executable,$(CLANG)),) + ifeq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1) + $(warning Warning: Disabled BPF skeletons as reliable BTF genera= tion needs at least $(CLANG) version 12.0.1) + else + $(warning Warning: Disabled BPF skeletons as clang is too old) + endif + else + $(warning Warning: Disabled BPF skeletons as bpf-gcc ($(BPF_GCC)) = needs at least version 14.0.0) + endif BUILD_BPF_SKEL :=3D 0 endif endif - ifeq ($(BUILD_BPF_SKEL),1) - $(call detected,CONFIG_PERF_BPF_SKEL) - CFLAGS +=3D -DHAVE_BPF_SKEL - endif endif =20 ifndef GEN_VMLINUX_H diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 2d9379fea267..4061a79cae54 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -37,6 +37,9 @@ include ../scripts/utilities.mak # Define EXTRA_BPF_FLAGS=3D"--sysroot=3D" or other custom include pa= ths for # cross-compiling BPF skeletons # +# Define BPF_GCC to point to the bpf-gcc binary if the default `bpf-gcc' i= s not +# correct, or set BPF_GCC=3D to disable using bpf-gcc for BPF skeletons. +# # Define EXCLUDE_EXTLIBS=3D-lmylib to exclude libmylib from the auto-gener= ated # EXTLIBS. # @@ -208,6 +211,7 @@ FIND =3D find INSTALL =3D install FLEX ?=3D flex BISON ?=3D bison +BPF_GCC ?=3D bpf-gcc AWK =3D awk =20 # include Makefile.config by default and rule out @@ -321,8 +325,8 @@ ifneq ($(force_fixdep),1) endif endif =20 -export srctree OUTPUT RM CC CXX RUSTC CLANG LD AR CFLAGS CXXFLAGS RUST_FLA= GS V BISON FLEX AWK LIBBPF READELF -export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK MYPY PYLINT CONFIG_PERF_= BPF_SKEL +export srctree OUTPUT RM CC CXX RUSTC CLANG BPF_GCC LD AR CFLAGS CXXFLAGS = RUST_FLAGS V BISON FLEX AWK LIBBPF READELF +export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK MYPY PYLINT CONFIG_PERF_= BPF_SKEL CONFIG_PERF_BPF_SKEL_BPF_GCC =20 include $(srctree)/tools/build/Makefile.include =20 diff --git a/tools/perf/bpf_skel.mak b/tools/perf/bpf_skel.mak index f2559de39f96..7b7edf506509 100644 --- a/tools/perf/bpf_skel.mak +++ b/tools/perf/bpf_skel.mak @@ -22,21 +22,35 @@ bpf-skel-prepare: $(BPFTOOL) $(VMLINUX_H) define get_sys_includes $(shell $(1) $(2) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/= .*\)|-idirafter \1|p }') \ -$(shell $(1) $(2) -dM -E - ; Tue, 13 Oct 2026 22:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791929820; cv=none; b=jaxFlAWNeb37uy46km2KG37k2blBf4bqMobHF7ELBhNWndWIX8iIc6hRRyaBJbbyz9sJJEpBW0mBDm4h7XRY/hQAlcnAMj8Lq63CLWn1ohJ/KQO85gNG0170veFmbK9xHJpMdtbYXTymYFmSmEL3vvTlRu5tY4qq6ynIjRHWrQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791929820; c=relaxed/simple; bh=4A/ANomF4iGWg9aVggtR1rNe+S7/Bw8fq2TxzSqyx/E=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gwLo/dl+D5QbJCCL+JQWeMzh7lOKRhGXrMn8EJS7DKl5jF5p6I0YOCoS0PgqPlm/l43693z5MlnJmLqO+PDIcrzQfWo0zEf2KiSD4KzjL/ZrA0SFNpQoTuIfrpUArx2ipgMG1Vhyn0mcWxgxKa36m4e+YCZh6hmBwhCWFIjXSdI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XZr0KG0V; arc=none smtp.client-ip=74.125.82.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XZr0KG0V" Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-341eff9e381so9371636eec.1 for ; Tue, 13 Oct 2026 15:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1791929816; x=1792534616; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hA27tTR2dWgZDMscmH9VhLIFtST18vRloUltjoMKrNs=; b=XZr0KG0V26Rr+9h/uEAuU6YAkBnkBfSGtvZcDik1XNVy+26gFyOoFq08ifRG42vRSB XtMgGr1rv1YyYpcpBaYhMQyyxay03fCWM6oplG99L/pyByBJWDcPPDcuQuZwH2CQHxmf jGl9QGxyEQ0pZix1YBSPdkWgAnsx2u7aIk9EMZJio9zk6wojnSx3/WWB3Rorm+EUrnf7 pdNIWrygMKTptkTrHqCNBOHyL8CeVVDACUHXzuyvS090MNqopQo1NX1QCYUKTqE71lix mM8b4nfT2iOyZMtrjCyTUyOmOy89MYqSgkQAKo1DN15iTMx/aF9GiDJY6NVQRM5WUrkk 7ZeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791929816; x=1792534616; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hA27tTR2dWgZDMscmH9VhLIFtST18vRloUltjoMKrNs=; b=THfQT519eMLBA81sM3SuWBsLD012GCEZC7NoOl0eehT9/vFHJ9kPYB+/FEQ/12wOCk IDYxIDKFnA9UxhBg2Ydd1WPvjDK/uYuXKsjREFUbnZ0J2mORefaF5g4yaUhblwgY0DlX bKW6r7HixdIgM3mRRhoMbMZXBiIlnndVnpZPblISTAUFsCPU6DtijtGqHams9tP4Spmw KJEs6cg2YqrCr7TqUe+KgAqZyRXkzqatF2Hw0eNa08c9J3zH7/HQVN5sdM41DIVBnoBj XdYGnTVPswzmVePzqJY7Pvl5Z5ip794okoylJQ+DSl0HEHxI7uLCd3WnSxef5u7Ezlgt Ml3w== X-Forwarded-Encrypted: i=1; AKwUvBwiDBQl3pBXwAYPpUN+jft9IctFwa8t+McqJGENeFyMvWmVb+OxL/izNf+Q3xAmLjAK1XtwvYL9pVtLupQ=@vger.kernel.org X-Gm-Message-State: AFq9FYLpu7IFp6VH3hDbebdWc8tNV6+Th5QpGgj/fhSOViPUzQTbjE+s R7pVy2iTFhFOZ9syhYVXbg8NI5i51KOKJmgoeao1oRSqU+PRqDGGuqp+0oBQTcu1gcmeMqkTgSH hykZLmvHxqQ== X-Received: from dlep8-n1.prod.google.com ([2002:a05:701b:4588:10b0:17c:109c:db31]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:701b:454b:20b0:144:fa79:174 with SMTP id a92af1059eb24-16a61f45109mr18552114c88.44.1791929816120; Tue, 13 Oct 2026 15:16:56 -0700 (PDT) Date: Tue, 13 Oct 2026 15:16:43 -0700 In-Reply-To: <20261013221643.1815686-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20261013221643.1815686-1-irogers@google.com> X-Mailer: git-send-email 2.56.0.385.gd3acb90ef8-goog Message-ID: <20261013221643.1815686-3-irogers@google.com> Subject: [PATCH v1 2/2] perf test make: Add BPF skeleton build tests for clang and bpf-gcc From: Ian Rogers To: Arnaldo Carvalho de Melo , Namhyung Kim , "Jose E . Marchesi" , David Faust , Cupertino Miranda Cc: Peter Zijlstra , Ingo Molnar , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Andrii Nakryiko , Eduard Zingerman , Yonghong Song , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add make_bpf_skel_clang (CLANG=3Dclang BPF_GCC=3D) and make_bpf_skel_bpf_gcc (BPF_GCC=3Dbpf-gcc CLANG=3D) targets to tools/perf/tests/make when the corresponding compiler and BPF skeleton dependencies are available on the host. Verify with 'perf check -q feature bpf_skeletons' that BPF skeleton support is enabled for both targets and disabled for make_no_bpf_skel. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers --- tools/perf/tests/make | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 7524de522802..4e66b93cf12c 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -78,6 +78,8 @@ make_extra_tests :=3D EXTRA_TESTS=3D1 make_no_jevents :=3D NO_JEVENTS=3D1 make_jevents_all :=3D JEVENTS_ARCH=3Dall make_no_bpf_skel :=3D BUILD_BPF_SKEL=3D0 +make_bpf_skel_clang :=3D CLANG=3Dclang BPF_GCC=3D +make_bpf_skel_bpf_gcc :=3D BPF_GCC=3Dbpf-gcc CLANG=3D make_gen_vmlinux_h :=3D GEN_VMLINUX_H=3D1 make_no_python_module :=3D NO_PYTHON_MODULE=3D1 make_no_scripts :=3D NO_PYTHON_MODULE=3D1 @@ -142,6 +144,20 @@ have_libllvm :=3D $(shell printf '#include \n#includ $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) >/dev/null 2>&1 && ech= o y) endif =20 +have_bpf_skel_deps :=3D $(shell printf '#include \n#include \n#include \n#include \nint main(){ret= urn 0;}\n' | \ + $(CC) -x c -I$(srctree)/tools/include/uapi - -o /dev/null -lelf -lz -lcry= pto >/dev/null 2>&1 && echo y) + +ifneq ($(have_bpf_skel_deps),) +ifneq ($(call has,clang),) +have_clang_bpf :=3D $(shell printf '#if (__clang_major__ < 12) || (__clang= _major__ =3D=3D 12 && __clang_minor__ =3D=3D 0 && __clang_patchlevel__ < 1)= \n#error "old"\n#endif\n' | \ + clang -S -g --target=3Dbpf -x c - -o /dev/null >/dev/null 2>&1 && echo y) +endif +ifneq ($(call has,bpf-gcc),) +have_bpf_gcc :=3D $(shell printf '#if __GNUC__ < 14\n#error "old"\n#endif\= n' | \ + bpf-gcc -E -x c - >/dev/null 2>&1 && echo y) +endif +endif + # $(run) contains all available tests run :=3D make_pure # Targets 'clean all' can be run together only through top level @@ -173,6 +189,12 @@ run +=3D make_extra_tests run +=3D make_no_jevents run +=3D make_jevents_all run +=3D make_no_bpf_skel +ifneq ($(have_clang_bpf),) +run +=3D make_bpf_skel_clang +endif +ifneq ($(have_bpf_gcc),) +run +=3D make_bpf_skel_bpf_gcc +endif run +=3D make_gen_vmlinux_h run +=3D make_no_python_module run +=3D make_no_scripts @@ -313,6 +335,13 @@ test_make_clang_nondistro :=3D $(test_make_clang) test_make_clang_nondistro_O :=3D $(test_make_clang_O) endif =20 +test_make_no_bpf_skel :=3D test -x $(PERF_O)/perf && ! $(PERF_O)/p= erf check -q feature bpf_skeletons +test_make_no_bpf_skel_O :=3D test -x $$TMP_O/perf && ! $$TMP_O/perf = check -q feature bpf_skeletons +test_make_bpf_skel_clang :=3D test -x $(PERF_O)/perf && $(PERF_O)/per= f check -q feature bpf_skeletons +test_make_bpf_skel_clang_O :=3D test -x $$TMP_O/perf && $$TMP_O/perf ch= eck -q feature bpf_skeletons +test_make_bpf_skel_bpf_gcc :=3D test -x $(PERF_O)/perf && $(PERF_O)/per= f check -q feature bpf_skeletons +test_make_bpf_skel_bpf_gcc_O :=3D test -x $$TMP_O/perf && $$TMP_O/perf ch= eck -q feature bpf_skeletons + test_make_python_perf_so_O :=3D test -f $$TMP_O/python/perf.so test_make_perf_o_O :=3D test -f $$TMP_O/perf.o test_make_util_map_o_O :=3D test -f $$TMP_O/util/map.o --=20 2.56.0.385.gd3acb90ef8-goog