bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools build feature: cleanup feature files on make clean
@ 2020-08-27  8:53 Jesper Dangaard Brouer
  2020-08-27 12:44 ` Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jesper Dangaard Brouer @ 2020-08-27  8:53 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Arnaldo Carvalho de Melo, linux-kernel
  Cc: Jiri Olsa, bpf

The system for "Auto-detecting system features" located under
tools/build/ are (currently) used by perf, libbpf and bpftool. It can
contain stalled feature detection files, which are not cleaned up by
libbpf and bpftool on make clean (side-note: perf tool is correct).

Fix this by making the users invoke the make clean target.

Some details about the changes. The libbpf Makefile already had a
clean-config target (which seems to be copy-pasted from perf), but this
target was not "connected" (a make dependency) to clean target. Choose
not to rename target as someone might be using it. Did change the output
from "CLEAN config" to "CLEAN feature-detect", to make it more clear
what happens.

This is related to the complaint and troubleshooting in link:
Link: https://lore.kernel.org/lkml/20200818122007.2d1cfe2d@carbon/

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
 tools/build/Makefile |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 8462690a039b..02c99bc95c69 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -176,7 +176,11 @@ $(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
 $(OUTPUT)%.o: %.c
 	$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $<
 
-clean: $(LIBBPF)-clean
+feature-detect-clean:
+	$(call QUIET_CLEAN, feature-detect)
+	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
+
+clean: $(LIBBPF)-clean feature-detect-clean
 	$(call QUIET_CLEAN, bpftool)
 	$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
 	$(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 727050c40f09..722f1700d96a 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -38,6 +38,8 @@ clean:
 	$(call QUIET_CLEAN, fixdep)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)rm -f $(OUTPUT)fixdep
+	$(call QUIET_CLEAN, feature-detect)
+	$(Q)$(MAKE) -C feature/ clean >/dev/null
 
 $(OUTPUT)fixdep-in.o: FORCE
 	$(Q)$(MAKE) $(build)=fixdep
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index bf8ed134cb8a..bbb89551468a 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -269,10 +269,10 @@ install: install_lib install_pkgconfig install_headers
 ### Cleaning rules
 
 config-clean:
-	$(call QUIET_CLEAN, config)
+	$(call QUIET_CLEAN, feature-detect)
 	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
 
-clean:
+clean: config-clean
 	$(call QUIET_CLEAN, libbpf) $(RM) -rf $(CMD_TARGETS)		     \
 		*~ .*.d .*.cmd LIBBPF-CFLAGS $(BPF_HELPER_DEFS)		     \
 		$(SHARED_OBJDIR) $(STATIC_OBJDIR)			     \



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

* Re: [PATCH] tools build feature: cleanup feature files on make clean
  2020-08-27  8:53 [PATCH] tools build feature: cleanup feature files on make clean Jesper Dangaard Brouer
@ 2020-08-27 12:44 ` Jiri Olsa
  2020-08-28 12:14 ` Daniel Borkmann
  2020-09-03 19:03 ` Arnaldo Carvalho de Melo
  2 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2020-08-27 12:44 UTC (permalink / raw)
  To: Jesper Dangaard Brouer
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Jiri Olsa, bpf

On Thu, Aug 27, 2020 at 10:53:36AM +0200, Jesper Dangaard Brouer wrote:
> The system for "Auto-detecting system features" located under
> tools/build/ are (currently) used by perf, libbpf and bpftool. It can
> contain stalled feature detection files, which are not cleaned up by
> libbpf and bpftool on make clean (side-note: perf tool is correct).
> 
> Fix this by making the users invoke the make clean target.
> 
> Some details about the changes. The libbpf Makefile already had a
> clean-config target (which seems to be copy-pasted from perf), but this
> target was not "connected" (a make dependency) to clean target. Choose
> not to rename target as someone might be using it. Did change the output
> from "CLEAN config" to "CLEAN feature-detect", to make it more clear
> what happens.
> 
> This is related to the complaint and troubleshooting in link:
> Link: https://lore.kernel.org/lkml/20200818122007.2d1cfe2d@carbon/

sry, I forgot about this one.. the change looks good to me

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> 
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---
>  tools/build/Makefile |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 8462690a039b..02c99bc95c69 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -176,7 +176,11 @@ $(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
>  $(OUTPUT)%.o: %.c
>  	$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $<
>  
> -clean: $(LIBBPF)-clean
> +feature-detect-clean:
> +	$(call QUIET_CLEAN, feature-detect)
> +	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
> +
> +clean: $(LIBBPF)-clean feature-detect-clean
>  	$(call QUIET_CLEAN, bpftool)
>  	$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
>  	$(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index 727050c40f09..722f1700d96a 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -38,6 +38,8 @@ clean:
>  	$(call QUIET_CLEAN, fixdep)
>  	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>  	$(Q)rm -f $(OUTPUT)fixdep
> +	$(call QUIET_CLEAN, feature-detect)
> +	$(Q)$(MAKE) -C feature/ clean >/dev/null
>  
>  $(OUTPUT)fixdep-in.o: FORCE
>  	$(Q)$(MAKE) $(build)=fixdep
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index bf8ed134cb8a..bbb89551468a 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -269,10 +269,10 @@ install: install_lib install_pkgconfig install_headers
>  ### Cleaning rules
>  
>  config-clean:
> -	$(call QUIET_CLEAN, config)
> +	$(call QUIET_CLEAN, feature-detect)
>  	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
>  
> -clean:
> +clean: config-clean
>  	$(call QUIET_CLEAN, libbpf) $(RM) -rf $(CMD_TARGETS)		     \
>  		*~ .*.d .*.cmd LIBBPF-CFLAGS $(BPF_HELPER_DEFS)		     \
>  		$(SHARED_OBJDIR) $(STATIC_OBJDIR)			     \
> 
> 


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

* Re: [PATCH] tools build feature: cleanup feature files on make clean
  2020-08-27  8:53 [PATCH] tools build feature: cleanup feature files on make clean Jesper Dangaard Brouer
  2020-08-27 12:44 ` Jiri Olsa
@ 2020-08-28 12:14 ` Daniel Borkmann
  2020-09-03 19:03 ` Arnaldo Carvalho de Melo
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Borkmann @ 2020-08-28 12:14 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Arnaldo Carvalho de Melo, linux-kernel
  Cc: Jiri Olsa, bpf

On 8/27/20 10:53 AM, Jesper Dangaard Brouer wrote:
> The system for "Auto-detecting system features" located under
> tools/build/ are (currently) used by perf, libbpf and bpftool. It can
> contain stalled feature detection files, which are not cleaned up by
> libbpf and bpftool on make clean (side-note: perf tool is correct).
> 
> Fix this by making the users invoke the make clean target.
> 
> Some details about the changes. The libbpf Makefile already had a
> clean-config target (which seems to be copy-pasted from perf), but this
> target was not "connected" (a make dependency) to clean target. Choose
> not to rename target as someone might be using it. Did change the output
> from "CLEAN config" to "CLEAN feature-detect", to make it more clear
> what happens.
> 
> This is related to the complaint and troubleshooting in link:
> Link: https://lore.kernel.org/lkml/20200818122007.2d1cfe2d@carbon/
> 
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>

Applied to bpf-next, thanks!

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

* Re: [PATCH] tools build feature: cleanup feature files on make clean
  2020-08-27  8:53 [PATCH] tools build feature: cleanup feature files on make clean Jesper Dangaard Brouer
  2020-08-27 12:44 ` Jiri Olsa
  2020-08-28 12:14 ` Daniel Borkmann
@ 2020-09-03 19:03 ` Arnaldo Carvalho de Melo
  2020-09-03 19:20   ` Daniel Borkmann
  2 siblings, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-09-03 19:03 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Daniel Borkmann, Alexei Starovoitov
  Cc: linux-kernel, Jiri Olsa, bpf

Em Thu, Aug 27, 2020 at 10:53:36AM +0200, Jesper Dangaard Brouer escreveu:
> The system for "Auto-detecting system features" located under
> tools/build/ are (currently) used by perf, libbpf and bpftool. It can
> contain stalled feature detection files, which are not cleaned up by
> libbpf and bpftool on make clean (side-note: perf tool is correct).
> 
> Fix this by making the users invoke the make clean target.
> 
> Some details about the changes. The libbpf Makefile already had a
> clean-config target (which seems to be copy-pasted from perf), but this
> target was not "connected" (a make dependency) to clean target. Choose
> not to rename target as someone might be using it. Did change the output
> from "CLEAN config" to "CLEAN feature-detect", to make it more clear
> what happens.

Since this mostly touches BPF, should it go via the BPF tree?

- Arnaldo
 
> This is related to the complaint and troubleshooting in link:
> Link: https://lore.kernel.org/lkml/20200818122007.2d1cfe2d@carbon/
> 
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---
>  tools/build/Makefile |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 8462690a039b..02c99bc95c69 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -176,7 +176,11 @@ $(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
>  $(OUTPUT)%.o: %.c
>  	$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $<
>  
> -clean: $(LIBBPF)-clean
> +feature-detect-clean:
> +	$(call QUIET_CLEAN, feature-detect)
> +	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
> +
> +clean: $(LIBBPF)-clean feature-detect-clean
>  	$(call QUIET_CLEAN, bpftool)
>  	$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
>  	$(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index 727050c40f09..722f1700d96a 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -38,6 +38,8 @@ clean:
>  	$(call QUIET_CLEAN, fixdep)
>  	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>  	$(Q)rm -f $(OUTPUT)fixdep
> +	$(call QUIET_CLEAN, feature-detect)
> +	$(Q)$(MAKE) -C feature/ clean >/dev/null
>  
>  $(OUTPUT)fixdep-in.o: FORCE
>  	$(Q)$(MAKE) $(build)=fixdep
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index bf8ed134cb8a..bbb89551468a 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -269,10 +269,10 @@ install: install_lib install_pkgconfig install_headers
>  ### Cleaning rules
>  
>  config-clean:
> -	$(call QUIET_CLEAN, config)
> +	$(call QUIET_CLEAN, feature-detect)
>  	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
>  
> -clean:
> +clean: config-clean
>  	$(call QUIET_CLEAN, libbpf) $(RM) -rf $(CMD_TARGETS)		     \
>  		*~ .*.d .*.cmd LIBBPF-CFLAGS $(BPF_HELPER_DEFS)		     \
>  		$(SHARED_OBJDIR) $(STATIC_OBJDIR)			     \
> 
> 

-- 

- Arnaldo

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

* Re: [PATCH] tools build feature: cleanup feature files on make clean
  2020-09-03 19:03 ` Arnaldo Carvalho de Melo
@ 2020-09-03 19:20   ` Daniel Borkmann
  2020-09-03 19:26     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Borkmann @ 2020-09-03 19:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jesper Dangaard Brouer, Alexei Starovoitov
  Cc: linux-kernel, Jiri Olsa, bpf

Hi Arnaldo,

On 9/3/20 9:03 PM, Arnaldo Carvalho de Melo wrote:
> Em Thu, Aug 27, 2020 at 10:53:36AM +0200, Jesper Dangaard Brouer escreveu:
>> The system for "Auto-detecting system features" located under
>> tools/build/ are (currently) used by perf, libbpf and bpftool. It can
>> contain stalled feature detection files, which are not cleaned up by
>> libbpf and bpftool on make clean (side-note: perf tool is correct).
>>
>> Fix this by making the users invoke the make clean target.
>>
>> Some details about the changes. The libbpf Makefile already had a
>> clean-config target (which seems to be copy-pasted from perf), but this
>> target was not "connected" (a make dependency) to clean target. Choose
>> not to rename target as someone might be using it. Did change the output
>> from "CLEAN config" to "CLEAN feature-detect", to make it more clear
>> what happens.
> 
> Since this mostly touches BPF, should it go via the BPF tree?

Already applied roughly a week ago:

https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=661b37cd437ef49cd28444f79b9b0c71ea76e8c8

Thanks,
Daniel

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

* Re: [PATCH] tools build feature: cleanup feature files on make clean
  2020-09-03 19:20   ` Daniel Borkmann
@ 2020-09-03 19:26     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-09-03 19:26 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Jesper Dangaard Brouer, Alexei Starovoitov, linux-kernel, Jiri Olsa, bpf

Em Thu, Sep 03, 2020 at 09:20:35PM +0200, Daniel Borkmann escreveu:
> Hi Arnaldo,
> 
> On 9/3/20 9:03 PM, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Aug 27, 2020 at 10:53:36AM +0200, Jesper Dangaard Brouer escreveu:
> > > The system for "Auto-detecting system features" located under
> > > tools/build/ are (currently) used by perf, libbpf and bpftool. It can
> > > contain stalled feature detection files, which are not cleaned up by
> > > libbpf and bpftool on make clean (side-note: perf tool is correct).
> > > 
> > > Fix this by making the users invoke the make clean target.
> > > 
> > > Some details about the changes. The libbpf Makefile already had a
> > > clean-config target (which seems to be copy-pasted from perf), but this
> > > target was not "connected" (a make dependency) to clean target. Choose
> > > not to rename target as someone might be using it. Did change the output
> > > from "CLEAN config" to "CLEAN feature-detect", to make it more clear
> > > what happens.
> > 
> > Since this mostly touches BPF, should it go via the BPF tree?
> 
> Already applied roughly a week ago:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=661b37cd437ef49cd28444f79b9b0c71ea76e8c8

Thanks!

- Arnaldo

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

end of thread, other threads:[~2020-09-03 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  8:53 [PATCH] tools build feature: cleanup feature files on make clean Jesper Dangaard Brouer
2020-08-27 12:44 ` Jiri Olsa
2020-08-28 12:14 ` Daniel Borkmann
2020-09-03 19:03 ` Arnaldo Carvalho de Melo
2020-09-03 19:20   ` Daniel Borkmann
2020-09-03 19:26     ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).