From: Mykola Lysenko <nickolay.lysenko@gmail.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, martin.lau@linux.dev, song@kernel.org,
yonghong.song@linux.dev, jolsa@kernel.org, memxor@gmail.com,
nickolay.lysenko@gmail.com
Subject: [PATCH bpf-next v7 2/9] selftests/bpf: drop stale lines, restore two header dependencies
Date: Sun, 23 Aug 2026 12:42:34 -0700 [thread overview]
Message-ID: <20260823194241.3415152-3-nickolay.lysenko@gmail.com> (raw)
In-Reply-To: <20260823194241.3415152-1-nickolay.lysenko@gmail.com>
Four target-specific lines name objects nothing builds. Three name
the BPF objects by their pre-rename names: commit afef88e65554
("selftests/bpf: Store BPF object files with .bpf.o extension") left
them without a target; the flow_dissector_load.o dependency names an
intermediate the generic one-step compile+link rule does not produce.
Three linked-skeleton dependency map entries (xsk_xdp_progs,
xdp_hw_metadata, xdp_features) were dead on arrival: commit
f0a249df1b07 ("selftests/xsk: get rid of built-in XDP program"),
commit 297a3f124155 ("selftests/bpf: Simple program to dump XDP RX
metadata") and commit 4dba3e7852b7 ("selftests/bpf: introduce XDP
compliance test tool") each added one, mimicking the neighboring
entries without adding the skeleton to LINKED_SKELS, the only place
the -deps map is read from; these three skeletons are generated by
the regular pattern rule, which never consults it.
The '-fno-inline' pair (test_l4lb_noinline, test_xdp_noinline) had
stopped taking effect even earlier, with commit 74b5a5968fe8
("selftests/bpf: Replace test_progs and test_maps w/ general rule"):
since then the BPF compile recipe expands TRUNNER_BPF_CFLAGS, a
simply-expanded copy of BPF_CFLAGS taken when the runner rules are
instantiated, which a target-specific 'BPF_CFLAGS +=' cannot reach.
Both programs have compiled without the flag since, and nothing was
lost: every function they define
carries a noinline annotation, except the SEC() entry points, which
nothing in the file calls, and the single __always_inline helper in
each, a deliberate exception the flag never overrode; and
compiling with -fno-inline restored yields byte-identical objects.
The two header dependencies with remaining value are restored in
working form. flow_dissector_load.h moves to the binary itself, which
is linked straight from its .c by the generic '$(OUTPUT)/%:%.c' rule
- editing the header now rebuilds it - on the line that already lists
the binary's helper object. cgroup_getset_retval_hooks.h -
added by commit e7215f574079 ("selftests/bpf: Make sure
bpf_{g,s}et_retval is exposed everywhere") days before the rename
orphaned it - lived in the top directory, outside the progs/*.h
blanket prerequisite of the BPF object rules, so editing it never
rebuilt the BPF object. Move it under progs/, next to its only BPF
consumer, where the blanket prerequisite covers it - the arrangement
several other headers shared between progs/ and prog_tests/ already
use. Its userspace consumer is tracked exactly by the
compiler-generated dependency files.
'CURDIR := $(abspath .)' redefines make's builtin to the value it
already has, and 'OBJCOPY ?= $(CROSS_COMPILE)objcopy' defines a
variable nothing in the selftests build or the included kselftest
infrastructure ever reads; drop both.
Signed-off-by: Mykola Lysenko <nickolay.lysenko@gmail.com>
---
tools/testing/selftests/bpf/Makefile | 13 +------------
.../selftests/bpf/prog_tests/cgroup_getset_retval.c | 2 +-
.../bpf/{ => progs}/cgroup_getset_retval_hooks.h | 0
3 files changed, 2 insertions(+), 13 deletions(-)
rename tools/testing/selftests/bpf/{ => progs}/cgroup_getset_retval_hooks.h (100%)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 118a7c356e26..c7c7f27dd860 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -4,9 +4,7 @@ include ../../../scripts/Makefile.arch
include ../../../scripts/Makefile.include
CXX ?= $(CROSS_COMPILE)g++
-OBJCOPY ?= $(CROSS_COMPILE)objcopy
-CURDIR := $(abspath .)
TOOLSDIR := $(abspath ../../..)
LIBDIR := $(TOOLSDIR)/lib
BPFDIR := $(LIBDIR)/bpf
@@ -342,7 +340,7 @@ $(OUTPUT)/test_tcpnotify_user: $(CGROUP_HELPERS) $(TESTING_HELPERS) $(TRACE_HELP
$(OUTPUT)/test_sock_fields: $(CGROUP_HELPERS) $(TESTING_HELPERS)
$(OUTPUT)/test_tag: $(TESTING_HELPERS)
$(OUTPUT)/test_lirc_mode2_user: $(TESTING_HELPERS)
-$(OUTPUT)/flow_dissector_load: $(TESTING_HELPERS)
+$(OUTPUT)/flow_dissector_load: $(TESTING_HELPERS) flow_dissector_load.h
$(OUTPUT)/test_maps: $(TESTING_HELPERS)
$(OUTPUT)/test_verifier: $(TESTING_HELPERS) $(CAP_HELPERS) $(UNPRIV_HELPERS)
$(OUTPUT)/xsk.o: $(BPFOBJ)
@@ -480,12 +478,6 @@ BPF_CFLAGS = -g -Wall -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \
CLANG_CFLAGS = $(CLANG_SYS_INCLUDES)
-$(OUTPUT)/test_l4lb_noinline.o: BPF_CFLAGS += -fno-inline
-$(OUTPUT)/test_xdp_noinline.o: BPF_CFLAGS += -fno-inline
-
-$(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
-$(OUTPUT)/cgroup_getset_retval_hooks.o: cgroup_getset_retval_hooks.h
-
# Build BPF object using Clang
# $1 - input .c file
# $2 - output .o file
@@ -546,9 +538,6 @@ linked_maps.skel.h-deps := linked_maps1.bpf.o linked_maps2.bpf.o
test_subskeleton.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o test_subskeleton.bpf.o
test_subskeleton_lib.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o
test_usdt.skel.h-deps := test_usdt.bpf.o test_usdt_multispec.bpf.o
-xsk_xdp_progs.skel.h-deps := xsk_xdp_progs.bpf.o
-xdp_hw_metadata.skel.h-deps := xdp_hw_metadata.bpf.o
-xdp_features.skel.h-deps := xdp_features.bpf.o
tracing_multi.skel.h-deps := tracing_multi_attach.bpf.o tracing_multi_check.bpf.o
tracing_multi_module.skel.h-deps := tracing_multi_attach_module.bpf.o tracing_multi_check.bpf.o
tracing_multi_intersect.skel.h-deps := tracing_multi_intersect_attach.bpf.o tracing_multi_check.bpf.o
diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c b/tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c
index 2bb5773d6f99..ea342859d6ce 100644
--- a/tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c
+++ b/tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c
@@ -465,7 +465,7 @@ struct exposed_hook {
.expected_err = EXPECTED_ERR, \
},
-#include "cgroup_getset_retval_hooks.h"
+#include "progs/cgroup_getset_retval_hooks.h"
#undef BPF_RETVAL_HOOK
};
diff --git a/tools/testing/selftests/bpf/cgroup_getset_retval_hooks.h b/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.h
similarity index 100%
rename from tools/testing/selftests/bpf/cgroup_getset_retval_hooks.h
rename to tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.h
--
2.43.0
next prev parent reply other threads:[~2026-08-23 19:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 19:42 [PATCH bpf-next v7 0/9] selftests/bpf: restructure the Makefile as a layered build Mykola Lysenko
2026-08-23 19:42 ` [PATCH bpf-next v7 1/9] selftests/bpf: keep headers off the generic link command line Mykola Lysenko
2026-08-23 19:42 ` Mykola Lysenko [this message]
2026-08-23 20:41 ` [PATCH bpf-next v7 2/9] selftests/bpf: drop stale lines, restore two header dependencies bot+bpf-ci
2026-08-24 22:47 ` Eduard Zingerman
2026-08-23 19:42 ` [PATCH bpf-next v7 3/9] selftests/bpf: factor the permissive-mode skip suffix into a helper Mykola Lysenko
2026-08-23 19:51 ` sashiko-bot
2026-08-23 19:42 ` [PATCH bpf-next v7 4/9] selftests/bpf: generate the signing key and certificate once Mykola Lysenko
2026-08-23 19:42 ` [PATCH bpf-next v7 5/9] selftests/bpf: generate verifier/tests.h in a regular recipe Mykola Lysenko
2026-08-23 19:42 ` [PATCH bpf-next v7 6/9] selftests/bpf: derive the bench object list from the sources Mykola Lysenko
2026-08-24 23:42 ` Eduard Zingerman
2026-08-23 19:42 ` [PATCH bpf-next v7 7/9] selftests/bpf: extract BPF skeleton generation into a helper script Mykola Lysenko
2026-08-23 19:42 ` [PATCH bpf-next v7 8/9] selftests/bpf: move shared build definitions into Makefile.buildvars Mykola Lysenko
2026-08-23 20:53 ` bot+bpf-ci
2026-08-25 6:45 ` Eduard Zingerman
2026-08-23 19:42 ` [PATCH bpf-next v7 9/9] selftests/bpf: build each test runner instance in its own sub-make Mykola Lysenko
2026-08-23 21:05 ` bot+bpf-ci
2026-08-25 23:55 ` Eduard Zingerman
2026-08-26 4:58 ` Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260823194241.3415152-3-nickolay.lysenko@gmail.com \
--to=nickolay.lysenko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox