BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Remove intermediate test files.
@ 2024-02-20 23:11 Alexei Starovoitov
  2024-02-21 16:19 ` Yonghong Song
  2024-02-21 16:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2024-02-20 23:11 UTC (permalink / raw)
  To: bpf; +Cc: daniel, andrii, martin.lau, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

The test of linking process creates several intermediate files.
Remove them once the build is over.
This reduces the number of files in selftests/bpf/ directory
from ~4400 to ~2600.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 tools/testing/selftests/bpf/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index a38a3001527c..c06de56bae59 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -537,6 +537,7 @@ $(TRUNNER_BPF_SKELS): %.skel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
 	$(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o)
 	$(Q)$$(BPFTOOL) gen skeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.bpf.o=)) > $$@
 	$(Q)$$(BPFTOOL) gen subskeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.bpf.o=)) > $$(@:.skel.h=.subskel.h)
+	$(Q)rm -f $$(<:.o=.linked1.o) $$(<:.o=.linked2.o) $$(<:.o=.linked3.o)
 
 $(TRUNNER_BPF_LSKELS): %.lskel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
 	$$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
@@ -545,6 +546,7 @@ $(TRUNNER_BPF_LSKELS): %.lskel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
 	$(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked3.o) $$(<:.o=.llinked2.o)
 	$(Q)diff $$(<:.o=.llinked2.o) $$(<:.o=.llinked3.o)
 	$(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.llinked3.o) name $$(notdir $$(<:.bpf.o=_lskel)) > $$@
+	$(Q)rm -f $$(<:.o=.linked1.o) $$(<:.o=.linked2.o) $$(<:.o=.linked3.o)
 
 $(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT)
 	$$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.bpf.o))
@@ -555,6 +557,7 @@ $(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT)
 	$$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
 	$(Q)$$(BPFTOOL) gen skeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$@
 	$(Q)$$(BPFTOOL) gen subskeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$(@:.skel.h=.subskel.h)
+	$(Q)rm -f $$(@:.skel.h=.linked1.o) $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked3.o)
 endif
 
 # ensure we set up tests.h header generation rule just once
-- 
2.34.1


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

* Re: [PATCH bpf-next] selftests/bpf: Remove intermediate test files.
  2024-02-20 23:11 [PATCH bpf-next] selftests/bpf: Remove intermediate test files Alexei Starovoitov
@ 2024-02-21 16:19 ` Yonghong Song
  2024-02-21 16:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2024-02-21 16:19 UTC (permalink / raw)
  To: Alexei Starovoitov, bpf; +Cc: daniel, andrii, martin.lau, kernel-team


On 2/20/24 3:11 PM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
>
> The test of linking process creates several intermediate files.
> Remove them once the build is over.
> This reduces the number of files in selftests/bpf/ directory
> from ~4400 to ~2600.
>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

It looks like some light skeleton *llinked*.o files left.
   [~/work/bpf-next/tools/testing/selftests/bpf (master)]$ ls *linked1*
   atomics.bpf.llinked1.o             fexit_sleep.bpf.llinked1.o              map_ptr_kern.bpf.llinked1.o       test_ringbuf_map_key.bpf.llinked1.o
   core_kern.bpf.llinked1.o           fexit_test.bpf.llinked1.o               test_ksyms_module.bpf.llinked1.o  test_static_linked1.bpf.o
   core_kern_overflow.bpf.llinked1.o  kfunc_call_test.bpf.llinked1.o          test_ksyms_weak.bpf.llinked1.o    trace_printk.bpf.llinked1.o
   fentry_test.bpf.llinked1.o         kfunc_call_test_subprog.bpf.llinked1.o  test_ringbuf.bpf.llinked1.o       trace_vprintk.bpf.llinked1.o
   [~/work/bpf-next/tools/testing/selftests/bpf (master)]$

All of them from:
   LSKELS := fentry_test.c fexit_test.c fexit_sleep.c atomics.c            \
         trace_printk.c trace_vprintk.c map_ptr_kern.c                   \
         core_kern.c core_kern_overflow.c test_ringbuf.c                 \
         test_ringbuf_map_key.c
   LSKELS_EXTRA := test_ksyms_module.c test_ksyms_weak.c kfunc_call_test.c \
         kfunc_call_test_subprog.c

Considering we only have limited light skeletons, so it should not be a problem. So

Acked-by: Yonghong Song <yonghong.song@linux.dev>


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

* Re: [PATCH bpf-next] selftests/bpf: Remove intermediate test files.
  2024-02-20 23:11 [PATCH bpf-next] selftests/bpf: Remove intermediate test files Alexei Starovoitov
  2024-02-21 16:19 ` Yonghong Song
@ 2024-02-21 16:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-21 16:30 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: bpf, daniel, andrii, martin.lau, kernel-team

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Tue, 20 Feb 2024 15:11:02 -0800 you wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> The test of linking process creates several intermediate files.
> Remove them once the build is over.
> This reduces the number of files in selftests/bpf/ directory
> from ~4400 to ~2600.
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: Remove intermediate test files.
    https://git.kernel.org/bpf/bpf-next/c/a48524a486f3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-02-21 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20 23:11 [PATCH bpf-next] selftests/bpf: Remove intermediate test files Alexei Starovoitov
2024-02-21 16:19 ` Yonghong Song
2024-02-21 16:30 ` 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