BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] selftests/bpf: specify libbpf headers required for %.bpf.o progs
@ 2024-08-28 17:46 Ihor Solodrai
  2024-08-28 17:46 ` [PATCH bpf-next 2/2] selftests/bpf: do not update vmlinux.h unnecessarily Ihor Solodrai
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ihor Solodrai @ 2024-08-28 17:46 UTC (permalink / raw)
  To: bpf, andrii; +Cc: ast, daniel, eddyz87, mykolal

Test %.bpf.o objects actually depend only on some libbpf headers.
Define a list of required headers and use it as TRUNNER_BPF_OBJS
dependency.

bpf_*.h list was determined by:

    $ grep -rh 'include <bpf/bpf_' progs | sort -u

Link:
https://lore.kernel.org/bpf/CAEf4BzYQ-j2i_xjs94Nn=8+FVfkWt51mLZyiYKiz9oA4Z=pCeA@mail.gmail.com/

Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
---
 tools/testing/selftests/bpf/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index c120617b64ad..53cc13b92ee2 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -516,6 +516,12 @@ xdp_features.skel.h-deps := xdp_features.bpf.o
 LINKED_BPF_OBJS := $(foreach skel,$(LINKED_SKELS),$($(skel)-deps))
 LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.c,$(LINKED_BPF_OBJS))
 
+HEADERS_FOR_BPF_OBJS := $(wildcard $(BPFDIR)/*.bpf.h)		\
+			$(addprefix $(BPFDIR)/,	bpf_core_read.h	\
+			                        bpf_endian.h	\
+						bpf_helpers.h	\
+			                        bpf_tracing.h)
+
 # Set up extra TRUNNER_XXX "temporary" variables in the environment (relies on
 # $eval()) and pass control to DEFINE_TEST_RUNNER_RULES.
 # Parameters:
@@ -566,8 +572,7 @@ $(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.bpf.o:				\
 		     $(TRUNNER_BPF_PROGS_DIR)/%.c			\
 		     $(TRUNNER_BPF_PROGS_DIR)/*.h			\
 		     $$(INCLUDE_DIR)/vmlinux.h				\
-		     $(wildcard $(BPFDIR)/bpf_*.h)			\
-		     $(wildcard $(BPFDIR)/*.bpf.h)			\
+		     $(HEADERS_FOR_BPF_OBJS)				\
 		     | $(TRUNNER_OUTPUT) $$(BPFOBJ)
 	$$(call $(TRUNNER_BPF_BUILD_RULE),$$<,$$@,			\
 					  $(TRUNNER_BPF_CFLAGS)         \
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-09-03 16:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 17:46 [PATCH bpf-next 1/2] selftests/bpf: specify libbpf headers required for %.bpf.o progs Ihor Solodrai
2024-08-28 17:46 ` [PATCH bpf-next 2/2] selftests/bpf: do not update vmlinux.h unnecessarily Ihor Solodrai
2024-08-28 22:02   ` Eduard Zingerman
2024-08-28 23:25     ` Alexei Starovoitov
2024-08-30 20:34     ` Andrii Nakryiko
2024-08-30 21:03       ` Alan Maguire
2024-08-30 23:42         ` Arnaldo Carvalho de Melo
2024-08-30 21:23       ` Mykyta Yatsenko
2024-08-30 22:18         ` Andrii Nakryiko
2024-08-31 18:18       ` Ihor Solodrai
2024-09-03 16:58         ` Andrii Nakryiko
2024-08-28 21:20 ` [PATCH bpf-next 1/2] selftests/bpf: specify libbpf headers required for %.bpf.o progs Eduard Zingerman
2024-08-30 20:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox