From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 6BFFB39D6F0 for ; Tue, 28 Apr 2026 23:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777419946; cv=none; b=R5/5L98kI46iFI2WRnjqXa5Emd8xq1SDXteqyIm9m5SMmQw78vlNut1mxPImbng97j+aZAxQLBo4rAPUlxjgQerVaRFxjRUYIX+Ua7y2QX5GU1tNHj6suRXGTEv3PkRA5x2iO/v+lDhrQ41K9sVgrS6jwHPSLd4WDeJ7jzLefBQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777419946; c=relaxed/simple; bh=L9HuTY0g8gIAf5yOwBttXUIxYT88+W0S1PATCxy+7ig=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l0MPG7c/pVLFsVEOvXdEw144AQtP8PfIZNOHFL9rrN4Haj99npagwUrn45q8FmkHW4WbjD+lWKRmYix+UWNrlgo87jiAXPbhry81nxgLxQ1SirbAQgwpHvQT5wbMQ96B4WNA6A0D+lp0yCDfgBsNI1wFDBvZh1EMqd1dbxEDoK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=cStilqlg; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="cStilqlg" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso125530475e9.2 for ; Tue, 28 Apr 2026 16:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777419943; x=1778024743; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NiBkOsP3D37NyL+KOe67WxRClt62TKa7PSBgpnWneMk=; b=cStilqlgUK+LQKPN2ofjIXLwoVL6oWxgMBYA5ymzztaio6qtaAlx1OQ1ubxCUr30hL zhnZbIeTvl3puG6YnP+eRCG3otbw9bff8DuGyk1atuwFX3EUx8VlZRXcKNYQ7bjr2cs+ ThpH+4vMFRB5OJ84l62lEvzUloJSp5rhYgGzyA9OhzYEHEECGvDwl7eHIf1zSqazG8Je YIrWxaYlNbOrlY2mjXwJ6R26pMtnifb4SZeSdtnY7fXHrHnJBzpgdt9vI4IeFdelGg0h mNtD/sV5C/hoA+xYQcwlaDnGvHgjyz9rUN9FbWLniN71DXXzpILdmVXc08HAak8o9Z0l mPXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777419943; x=1778024743; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=NiBkOsP3D37NyL+KOe67WxRClt62TKa7PSBgpnWneMk=; b=ZzR38rZqtXkO3PMV0CzzfDfe13TIS1gL+n6YeeVFTxUjwko8GwNBpnQHYT6yUYI0f+ jlRinihiZyHB+DCQXa8+sU8wlMQzx8r98QejK/aqFHlKoku+KiS1pl7TSDlk2QsJJskZ mkgPdiW0ySK4wZraizZ1B5GxitLfRLg0ayBjgKMLyHfH08kz8cpyC3iQcbfPfVNnq5qO ZzV+VHEKcbtdlVvrlk9aBbho0hTfaW+6apwj64OxuKeWcHuwhQNc7lWMxlTmo0OA9XaR uXLjy7z5AW6QmZLNDAReY0Hhu+wDb2YcTZqO91R6FbaypGFAflM323SkjOYiNCDKVsR8 0cvw== X-Forwarded-Encrypted: i=1; AFNElJ/meuSDJK9vVXa+y191dtwBoFZ3sn8gLAdzWf8hYx6RhxZacmxSStnvA2ZwyuMIxRLOgHOeiaKcwxjL+k8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxc2w4joww1z9OPf55yrj2RWr73N0xG+72BQ9sEvKoa9j6hz3f2 rjuqMzI6gDWwcj4nOhNrEIWhXW+BtZQ5VDliGAphg4d18qi7TFH8EHGpHzcBlDmec5A= X-Gm-Gg: AeBDiesjOD41vIGnDwzMy27+c19hbo62Vrx0LA06p7fqNl9T86z8C1UrWa2Etbcftfo 2zLtSc1Z4+UAKrxdZ/bCe/Af4urBF6pz7IN6ZH1L7YxIAFhCU4wBVdcxAjVntsqJLKMFPCTqsnT tAcJ7gI8uMUx0k1u6IEM9lX4ClQunBv5xLQT+aAZJe8ia3mzEjGjcgo2oAaKF3B/12893WY2n1Y jG3WXRhug7K/+T6mnaEEp4Jgbi+c5u4nZNCx8+z9kYeD03vDGM+Je03342cP3GZB8TyNg43KC6Q J8ycL+2QHTxg18F5y59fISwhFL+5jCzcJ+LiYqqgWaePKZxmPBT+zioVMs8UfdCKXXpFKriiVSK ALBhWb1jk6B+SP4rNmp1205w/uvz/19Yij51vrhu4DIZbCojogw5/zzLx13+j3X5TCyf4AWbpQC q52Makvct6MLYZdm3Pv6hU6wrM X-Received: by 2002:a05:600c:1382:b0:488:b99b:4177 with SMTP id 5b1f17b1804b1-48a77b232femr77940045e9.25.1777419942911; Tue, 28 Apr 2026 16:45:42 -0700 (PDT) Received: from localhost ([2804:7f0:b765:105d:ce28:aaff:fe86:149c]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-573b6bbace7sm247108e0c.5.2026.04.28.16.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2026 16:45:41 -0700 (PDT) From: =?utf-8?q?Ricardo_B=2E_Marli=C3=A8re?= Date: Tue, 28 Apr 2026 20:45:07 -0300 Subject: [PATCH bpf-next v8 06/11] selftests/bpf: Tolerate test file compilation failures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260428-selftests-bpf_misconfig-v8-6-bf02cf97dbcb@suse.com> References: <20260428-selftests-bpf_misconfig-v8-0-bf02cf97dbcb@suse.com> In-Reply-To: <20260428-selftests-bpf_misconfig-v8-0-bf02cf97dbcb@suse.com> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Alan Maguire , "Ricardo B. Marliere" X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openssh-sha256; t=1777419912; l=2530; i=rbm@suse.com; h=from:subject:message-id; bh=L9HuTY0g8gIAf5yOwBttXUIxYT88+W0S1PATCxy+7ig=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgguRCc5X8/UX9M40lkMnr//aFGOhce x5ezt8MFNUFlqYAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QKrl4FW9lTL2fKXCoxAttbRH4v2StF8TjG5J7aB7amC9XyO8MvqrLBBGkS6a2KmtCFalKLmK1Rd b52LNnLz0Lgo= X-Developer-Key: i=rbm@suse.com; a=openssh; fpr=SHA256:pzhe0fJpYLz+3cZ33FFPhIfaUElk9CXPFFXmalIH+1g Individual test files may fail to compile when headers or kernel features required by that test are absent. Currently this aborts the entire build. Make the per-test compilation non-fatal in permissive mode: remove the output object on failure and print a SKIP-TEST marker to stderr. Guard the BTFIDS post-processing step so it is skipped when the object file is absent. The linker step will later ignore absent objects, allowing the remaining tests to build and run. Use plain printf and $(Q) instead of $(call msg,...) in the BTFIDS block: the msg macro expands to @printf, which is a make-recipe construct and is invalid as a shell command inside an if-then-fi body; $(Q) restores echo suppression at the recipe level where it is meaningful. Note on bisectability: this change is gated entirely behind PERMISSIVE, so default builds (BPF_STRICT_BUILD!=0) compile and run identically at every commit. In PERMISSIVE mode, this commit alone is incomplete: the linker still rejects missing objects and the runtime still aborts on NULL function pointers; those issues are addressed by the two commits that follow in this series. Signed-off-by: Ricardo B. Marlière --- tools/testing/selftests/bpf/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 608e6dff0392..f0545ee6b32a 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -717,11 +717,14 @@ $(TRUNNER_TEST_OBJS): $(TRUNNER_OUTPUT)/%.test.o: \ $(TRUNNER_TESTS_DIR)/%.c \ | $(TRUNNER_OUTPUT)/%.test.d $$(call msg,TEST-OBJ,$(TRUNNER_BINARY),$$@) - $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< $$(LDLIBS) -o $$(@F) + $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< $$(LDLIBS) -o $$(@F) $(if $(PERMISSIVE),|| \ + ($(RM) $$(@F); printf ' %-12s %s\n' 'SKIP-TEST' '$$(notdir $$@)' 1>&2)) $$(if $$(TEST_NEEDS_BTFIDS), \ - $$(call msg,BTFIDS,$(TRUNNER_BINARY),$$@) \ + $(Q)if [ -f $$@ ]; then \ + printf ' %-8s%s %s\n' "BTFIDS" " [$(TRUNNER_BINARY)]" "$$(notdir $$@)"; \ $(RESOLVE_BTFIDS) --btf $(TRUNNER_OUTPUT)/btf_data.bpf.o $$@; \ - $(RESOLVE_BTFIDS) --patch_btfids $$@.BTF_ids $$@) + $(RESOLVE_BTFIDS) --patch_btfids $$@.BTF_ids $$@; \ + fi) $(TRUNNER_TEST_OBJS:.o=.d): $(TRUNNER_OUTPUT)/%.test.d: \ $(TRUNNER_TESTS_DIR)/%.c \ -- 2.54.0