linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tools build: Introduce features dump include makefile
@ 2015-11-26 13:54 Jiri Olsa
  2015-11-26 13:54 ` [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 13:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Creating the FEATURE-INCLUDE file, that contains all features
status dumped in make's variable format:
   ...
   feature-backtrace=1
   feature-dwarf=1
   ...

It's purpose is to be included in sub-project makefiles to get
features detection state. This way we can run the detection only
in top level project and propagate it down.

Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-fcq5rtdhcu4300sjp2p8l936@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile.feature | 12 ++++++++++++
 tools/perf/.gitignore        |  1 +
 tools/perf/Makefile.perf     |  2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 37ff4c9f92f1..51f8d5928f98 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -131,6 +131,16 @@ ifeq ($(dwarf-post-unwind),1)
   FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
 endif
 
+# The FEATURE-INCLUDE file contains all features status
+# dumped in make's variable format:
+#   ...
+#   feature-backtrace=1
+#   feature-dwarf=1
+#   ...
+# It's to be included in sub-project makefiles to get
+# features detection state.
+FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
+
 # The $(feature_display) controls the default detection message
 # output. It's set if:
 # - detected features differes from stored features from
@@ -140,6 +150,8 @@ endif
 
 ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
   $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
+  $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
+  $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
   feature_display := 1
 endif
 
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 3d1bb802dbf4..4a3eb8dedc54 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -2,6 +2,7 @@ PERF-CFLAGS
 PERF-GUI-VARS
 PERF-VERSION-FILE
 FEATURE-DUMP
+FEATURE-INCLUDE
 perf
 perf-read-vdso32
 perf-read-vdsox32
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0d19d5447d6c..97badfa2a195 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
 	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
+	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
 		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
 	$(python-clean)
-- 
2.4.3


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

* [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
  2015-11-26 13:54 [PATCH 1/3] tools build: Introduce features dump include makefile Jiri Olsa
@ 2015-11-26 13:54 ` Jiri Olsa
  2015-11-26 16:31   ` Arnaldo Carvalho de Melo
  2015-11-26 13:54 ` [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa
  2015-11-26 16:23 ` [PATCH 1/3] tools build: Introduce features dump include makefile Arnaldo Carvalho de Melo
  2 siblings, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 13:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Using FEATURE-INCLUDE in bpf subproject in case bpf is built
via perf. Keep the current features detection for other cases.

Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/bpf/Makefile   | 4 ++++
 tools/perf/Makefile.perf | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index a3caaf3eafbd..f0818f3b0d40 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -71,7 +71,11 @@ FEATURE_DISPLAY = libelf bpf
 INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
 FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
 
+ifeq ($(FEATURES_INCLUDE),)
 include $(srctree)/tools/build/Makefile.feature
+else
+include $(FEATURES_INCLUDE)
+endif
 
 export prefix libdir src obj
 
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 97badfa2a195..d2b20a1f4a21 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -431,7 +431,7 @@ $(LIBAPI)-clean:
 	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
 
 $(LIBBPF): fixdep FORCE
-	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a
+	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_INCLUDE=$(realpath $(OUTPUT)FEATURE-INCLUDE)
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
-- 
2.4.3


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

* [PATCH 3/3] perf build: Fix traceevent plugins build race
  2015-11-26 13:54 [PATCH 1/3] tools build: Introduce features dump include makefile Jiri Olsa
  2015-11-26 13:54 ` [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
@ 2015-11-26 13:54 ` Jiri Olsa
  2015-11-26 16:36   ` Arnaldo Carvalho de Melo
  2015-11-27  7:44   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-11-26 16:23 ` [PATCH 1/3] tools build: Introduce features dump include makefile Arnaldo Carvalho de Melo
  2 siblings, 2 replies; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 13:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Ingo reported following build failure:

  $ make clean install
  ...
    CC       plugin_kmem.o
  fixdep: error opening depfile: ./.plugin_hrtimer.o.d: No such file or directory
  /home/mingo/tip/tools/build/Makefile.build:77: recipe for target
  'plugin_hrtimer.o' failed
  make[3]: *** [plugin_hrtimer.o] Error 2
  Makefile:189: recipe for target 'plugin_hrtimer-in.o' failed
  make[2]: *** [plugin_hrtimer-in.o] Error 2
  Makefile.perf:414: recipe for target 'libtraceevent_plugins' failed
  make[1]: *** [libtraceevent_plugins] Error 2
  make[1]: *** Waiting for unfinished jobs....

Currently we have the install-traceevent-plugins target being
dependent on $(LIBTRACEEVENT), which will actualy not build
any plugin. So the install-traceevent-plugins target itself
will try to build plugins, but..

Plugins built is also triggered by perf build itself via
libtraceevent_plugins target.

This might cause a race having one make thread removing
temp files from another and result in above error. Fixing
this by having proper plugins build dependency before
installing plugins.

Reported-and-Tested-by:: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/n/tip-8mlj1skxxg89p4bpo6qnt930@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index d2b20a1f4a21..7338a7e62fcd 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -420,7 +420,7 @@ $(LIBTRACEEVENT)-clean:
 	$(call QUIET_CLEAN, libtraceevent)
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
 
-install-traceevent-plugins: $(LIBTRACEEVENT)
+install-traceevent-plugins: libtraceevent_plugins
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
 
 $(LIBAPI): fixdep FORCE
-- 
2.4.3


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

* Re: [PATCH 1/3] tools build: Introduce features dump include makefile
  2015-11-26 13:54 [PATCH 1/3] tools build: Introduce features dump include makefile Jiri Olsa
  2015-11-26 13:54 ` [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
  2015-11-26 13:54 ` [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa
@ 2015-11-26 16:23 ` Arnaldo Carvalho de Melo
  2 siblings, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-26 16:23 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Em Thu, Nov 26, 2015 at 02:54:02PM +0100, Jiri Olsa escreveu:
> Creating the FEATURE-INCLUDE file, that contains all features
> status dumped in make's variable format:
>    ...
>    feature-backtrace=1
>    feature-dwarf=1
>    ...
> 
> It's purpose is to be included in sub-project makefiles to get
> features detection state. This way we can run the detection only
> in top level project and propagate it down.

See, you can do it, nice explanation! :-)

- Arnaldo
 
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: http://lkml.kernel.org/n/tip-fcq5rtdhcu4300sjp2p8l936@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/build/Makefile.feature | 12 ++++++++++++
>  tools/perf/.gitignore        |  1 +
>  tools/perf/Makefile.perf     |  2 +-
>  3 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 37ff4c9f92f1..51f8d5928f98 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -131,6 +131,16 @@ ifeq ($(dwarf-post-unwind),1)
>    FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
>  endif
>  
> +# The FEATURE-INCLUDE file contains all features status
> +# dumped in make's variable format:
> +#   ...
> +#   feature-backtrace=1
> +#   feature-dwarf=1
> +#   ...
> +# It's to be included in sub-project makefiles to get
> +# features detection state.
> +FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
> +
>  # The $(feature_display) controls the default detection message
>  # output. It's set if:
>  # - detected features differes from stored features from
> @@ -140,6 +150,8 @@ endif
>  
>  ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
>    $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
> +  $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
> +  $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
>    feature_display := 1
>  endif
>  
> diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
> index 3d1bb802dbf4..4a3eb8dedc54 100644
> --- a/tools/perf/.gitignore
> +++ b/tools/perf/.gitignore
> @@ -2,6 +2,7 @@ PERF-CFLAGS
>  PERF-GUI-VARS
>  PERF-VERSION-FILE
>  FEATURE-DUMP
> +FEATURE-INCLUDE
>  perf
>  perf-read-vdso32
>  perf-read-vdsox32
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 0d19d5447d6c..97badfa2a195 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
>  	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>  	$(Q)$(RM) $(OUTPUT).config-detected
>  	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
> -	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
> +	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
>  		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
>  	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
>  	$(python-clean)
> -- 
> 2.4.3

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

* Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
  2015-11-26 13:54 ` [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
@ 2015-11-26 16:31   ` Arnaldo Carvalho de Melo
  2015-11-26 18:11     ` Jiri Olsa
  2015-11-26 18:12     ` Jiri Olsa
  0 siblings, 2 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-26 16:31 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Em Thu, Nov 26, 2015 at 02:54:03PM +0100, Jiri Olsa escreveu:
> Using FEATURE-INCLUDE in bpf subproject in case bpf is built
> via perf. Keep the current features detection for other cases.
> 
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Clashes with:

d8ad6a15cc3a ("tools lib bpf: Don't do a feature check when cleaning")

That has, at that point:

+check_feat := 1
+NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
+ifdef MAKECMDGOALS
+ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
+  check_feat := 0
+endif
+endif
+
+ifeq ($(check_feat),1)
 include $(srctree)/tools/build/Makefile.feature
+endif

On a related note:

  [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
  make: Entering directory '/home/git/linux/tools/perf'
    BUILD:   Doing 'make -j4' parallel build
  make[2]: Nothing to be done for 'fixdep'.
  make: Leaving directory '/home/git/linux/tools/perf'

Can we get away with that "make[2]: Nothing to be done for 'fixdep'."
line?

- Arnaldo

> ---
>  tools/lib/bpf/Makefile   | 4 ++++
>  tools/perf/Makefile.perf | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index a3caaf3eafbd..f0818f3b0d40 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -71,7 +71,11 @@ FEATURE_DISPLAY = libelf bpf
>  INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
>  FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
>  
> +ifeq ($(FEATURES_INCLUDE),)
>  include $(srctree)/tools/build/Makefile.feature
> +else
> +include $(FEATURES_INCLUDE)
> +endif
>  
>  export prefix libdir src obj
>  
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 97badfa2a195..d2b20a1f4a21 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -431,7 +431,7 @@ $(LIBAPI)-clean:
>  	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
>  
>  $(LIBBPF): fixdep FORCE
> -	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a
> +	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_INCLUDE=$(realpath $(OUTPUT)FEATURE-INCLUDE)
>  
>  $(LIBBPF)-clean:
>  	$(call QUIET_CLEAN, libbpf)
> -- 
> 2.4.3

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

* Re: [PATCH 3/3] perf build: Fix traceevent plugins build race
  2015-11-26 13:54 ` [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa
@ 2015-11-26 16:36   ` Arnaldo Carvalho de Melo
  2015-11-27  7:44   ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-26 16:36 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Em Thu, Nov 26, 2015 at 02:54:04PM +0100, Jiri Olsa escreveu:
> Plugins built is also triggered by perf build itself via
> libtraceevent_plugins target.
> 
> This might cause a race having one make thread removing
> temp files from another and result in above error. Fixing
> this by having proper plugins build dependency before
> installing plugins.
> 
>  Reported-and-Tested-by:: Ingo Molnar <mingo@kernel.org>

Thanks, applied.

- Arnaldo

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

* Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
  2015-11-26 16:31   ` Arnaldo Carvalho de Melo
@ 2015-11-26 18:11     ` Jiri Olsa
  2015-11-26 18:12     ` Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 18:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Wang Nan, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Peter Zijlstra

On Thu, Nov 26, 2015 at 01:31:30PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Nov 26, 2015 at 02:54:03PM +0100, Jiri Olsa escreveu:
> > Using FEATURE-INCLUDE in bpf subproject in case bpf is built
> > via perf. Keep the current features detection for other cases.
> > 
> > Cc: Wang Nan <wangnan0@huawei.com>
> > Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> Clashes with:
> 
> d8ad6a15cc3a ("tools lib bpf: Don't do a feature check when cleaning")
> 
> That has, at that point:
> 
> +check_feat := 1
> +NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
> +ifdef MAKECMDGOALS
> +ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
> +  check_feat := 0
> +endif
> +endif
> +
> +ifeq ($(check_feat),1)
>  include $(srctree)/tools/build/Makefile.feature
> +endif

I see, please take that one, I'll rebase my changes over that

we still need more comments/feedback on that anyway ;-)

jirka

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

* Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
  2015-11-26 16:31   ` Arnaldo Carvalho de Melo
  2015-11-26 18:11     ` Jiri Olsa
@ 2015-11-26 18:12     ` Jiri Olsa
  2015-11-26 18:50       ` [PATCH] tools build: Use fixdep with OUTPUT path prefix Jiri Olsa
  1 sibling, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 18:12 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Wang Nan, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Peter Zijlstra

On Thu, Nov 26, 2015 at 01:31:30PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Nov 26, 2015 at 02:54:03PM +0100, Jiri Olsa escreveu:
> > Using FEATURE-INCLUDE in bpf subproject in case bpf is built
> > via perf. Keep the current features detection for other cases.
> > 
> > Cc: Wang Nan <wangnan0@huawei.com>
> > Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> Clashes with:
> 
> d8ad6a15cc3a ("tools lib bpf: Don't do a feature check when cleaning")
> 
> That has, at that point:
> 
> +check_feat := 1
> +NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
> +ifdef MAKECMDGOALS
> +ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
> +  check_feat := 0
> +endif
> +endif
> +
> +ifeq ($(check_feat),1)
>  include $(srctree)/tools/build/Makefile.feature
> +endif
> 
> On a related note:
> 
>   [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
>   make: Entering directory '/home/git/linux/tools/perf'
>     BUILD:   Doing 'make -j4' parallel build
>   make[2]: Nothing to be done for 'fixdep'.
>   make: Leaving directory '/home/git/linux/tools/perf'
> 
> Can we get away with that "make[2]: Nothing to be done for 'fixdep'."
> line?

I'll check on that

jirka

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

* [PATCH] tools build: Use fixdep with OUTPUT path prefix
  2015-11-26 18:12     ` Jiri Olsa
@ 2015-11-26 18:50       ` Jiri Olsa
  2015-11-26 19:31         ` Arnaldo Carvalho de Melo
  2015-11-27  7:45         ` [tip:perf/core] " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 12+ messages in thread
From: Jiri Olsa @ 2015-11-26 18:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Wang Nan, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Peter Zijlstra

On Thu, Nov 26, 2015 at 07:12:04PM +0100, Jiri Olsa wrote:
> On Thu, Nov 26, 2015 at 01:31:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Nov 26, 2015 at 02:54:03PM +0100, Jiri Olsa escreveu:
> > > Using FEATURE-INCLUDE in bpf subproject in case bpf is built
> > > via perf. Keep the current features detection for other cases.
> > > 
> > > Cc: Wang Nan <wangnan0@huawei.com>
> > > Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
> > > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > 
> > Clashes with:
> > 
> > d8ad6a15cc3a ("tools lib bpf: Don't do a feature check when cleaning")
> > 
> > That has, at that point:
> > 
> > +check_feat := 1
> > +NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
> > +ifdef MAKECMDGOALS
> > +ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
> > +  check_feat := 0
> > +endif
> > +endif
> > +
> > +ifeq ($(check_feat),1)
> >  include $(srctree)/tools/build/Makefile.feature
> > +endif
> > 
> > On a related note:
> > 
> >   [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
> >   make: Entering directory '/home/git/linux/tools/perf'
> >     BUILD:   Doing 'make -j4' parallel build
> >   make[2]: Nothing to be done for 'fixdep'.
> >   make: Leaving directory '/home/git/linux/tools/perf'
> > 
> > Can we get away with that "make[2]: Nothing to be done for 'fixdep'."
> > line?
> 
> I'll check on that

good we don't supress all make's output, sometimes it
finds a bug ;-) please check with attached patch..

thanks,
jirka


---
Adding OUTPUT path prefix for fixdep target
so we use it properly in out of tree builds.

If the fixdep already existed in the tree, the out of
tree build would see it already exist and did not build
the out of tree version, as reported by Arnaldo:

  [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
  make: Entering directory '/home/git/linux/tools/perf'
    BUILD:   Doing 'make -j4' parallel build
  make[2]: Nothing to be done for 'fixdep'.
  make: Leaving directory '/home/git/linux/tools/perf'

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/n/tip-hsrwmiogt9menjsg7uaxqvq2@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile         | 2 +-
 tools/build/Makefile.include | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index a93036272d43..0d5a0e3a8fa9 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -25,7 +25,7 @@ export Q srctree CC LD
 MAKEFLAGS := --no-print-directory
 build     := -f $(srctree)/tools/build/Makefile.build dir=. obj
 
-all: fixdep
+all: $(OUTPUT)fixdep
 
 clean:
 	$(call QUIET_CLEAN, fixdep)
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
index 4e09ad617a60..6d5edd275bef 100644
--- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include
@@ -4,7 +4,7 @@ ifdef CROSS_COMPILE
 fixdep:
 else
 fixdep:
-	$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
+	$(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep
 endif
 
 .PHONY: fixdep
-- 
2.4.3


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

* Re: [PATCH] tools build: Use fixdep with OUTPUT path prefix
  2015-11-26 18:50       ` [PATCH] tools build: Use fixdep with OUTPUT path prefix Jiri Olsa
@ 2015-11-26 19:31         ` Arnaldo Carvalho de Melo
  2015-11-27  7:45         ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-26 19:31 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jiri Olsa, Wang Nan, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Peter Zijlstra

Em Thu, Nov 26, 2015 at 07:50:55PM +0100, Jiri Olsa escreveu:
> On Thu, Nov 26, 2015 at 07:12:04PM +0100, Jiri Olsa wrote:
> > On Thu, Nov 26, 2015 at 01:31:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Em Thu, Nov 26, 2015 at 02:54:03PM +0100, Jiri Olsa escreveu:
> > > > Using FEATURE-INCLUDE in bpf subproject in case bpf is built
> > > > via perf. Keep the current features detection for other cases.
> > > > 
> > > > Cc: Wang Nan <wangnan0@huawei.com>
> > > > Link: http://lkml.kernel.org/n/tip-utuczk899ckz6qtggqvhm7yu@git.kernel.org
> > > > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > > 
> > > Clashes with:
> > > 
> > > d8ad6a15cc3a ("tools lib bpf: Don't do a feature check when cleaning")
> > > 
> > > That has, at that point:
> > > 
> > > +check_feat := 1
> > > +NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
> > > +ifdef MAKECMDGOALS
> > > +ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
> > > +  check_feat := 0
> > > +endif
> > > +endif
> > > +
> > > +ifeq ($(check_feat),1)
> > >  include $(srctree)/tools/build/Makefile.feature
> > > +endif
> > > 
> > > On a related note:
> > > 
> > >   [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
> > >   make: Entering directory '/home/git/linux/tools/perf'
> > >     BUILD:   Doing 'make -j4' parallel build
> > >   make[2]: Nothing to be done for 'fixdep'.
> > >   make: Leaving directory '/home/git/linux/tools/perf'
> > > 
> > > Can we get away with that "make[2]: Nothing to be done for 'fixdep'."
> > > line?
> > 
> > I'll check on that
> 
> good we don't supress all make's output, sometimes it
> finds a bug ;-) please check with attached patch..
> 
> thanks,
> jirka

Clashes with:

commit 5725dd8fa888b4dcdff58241f9d3d3ac42a048e2
Author: Wang Nan <wangnan0@huawei.com>
Date:   Tue Nov 24 13:36:06 2015 +0000

    tools build: Clean CFLAGS and LDFLAGS for fixdep


And this should even be already in tip, let me see, yes:

https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?h=perf/core&id=5725dd8fa888b4dcdff58241f9d3d3ac42a048e2

I'm fixing this up, as this one is easy.

- Arnaldo


 
> 
> ---
> Adding OUTPUT path prefix for fixdep target
> so we use it properly in out of tree builds.
> 
> If the fixdep already existed in the tree, the out of
> tree build would see it already exist and did not build
> the out of tree version, as reported by Arnaldo:
> 
>   [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
>   make: Entering directory '/home/git/linux/tools/perf'
>     BUILD:   Doing 'make -j4' parallel build
>   make[2]: Nothing to be done for 'fixdep'.
>   make: Leaving directory '/home/git/linux/tools/perf'
> 
> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Link: http://lkml.kernel.org/n/tip-hsrwmiogt9menjsg7uaxqvq2@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/build/Makefile         | 2 +-
>  tools/build/Makefile.include | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index a93036272d43..0d5a0e3a8fa9 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -25,7 +25,7 @@ export Q srctree CC LD
>  MAKEFLAGS := --no-print-directory
>  build     := -f $(srctree)/tools/build/Makefile.build dir=. obj
>  
> -all: fixdep
> +all: $(OUTPUT)fixdep
>  
>  clean:
>  	$(call QUIET_CLEAN, fixdep)
> diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
> index 4e09ad617a60..6d5edd275bef 100644
> --- a/tools/build/Makefile.include
> +++ b/tools/build/Makefile.include
> @@ -4,7 +4,7 @@ ifdef CROSS_COMPILE
>  fixdep:
>  else
>  fixdep:
> -	$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
> +	$(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep
>  endif
>  
>  .PHONY: fixdep
> -- 
> 2.4.3

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

* [tip:perf/core] perf build: Fix traceevent plugins build race
  2015-11-26 13:54 ` [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa
  2015-11-26 16:36   ` Arnaldo Carvalho de Melo
@ 2015-11-27  7:44   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-11-27  7:44 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jolsa, hpa, namhyung, mingo, tglx, acme,
	a.p.zijlstra, dsahern

Commit-ID:  67befc652845c8ffbefc8d173a6e6ced14d472f1
Gitweb:     http://git.kernel.org/tip/67befc652845c8ffbefc8d173a6e6ced14d472f1
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 26 Nov 2015 14:54:04 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 26 Nov 2015 13:35:38 -0300

perf build: Fix traceevent plugins build race

Ingo reported following build failure:

  $ make clean install
  ...
    CC       plugin_kmem.o
  fixdep: error opening depfile: ./.plugin_hrtimer.o.d: No such file or directory
  /home/mingo/tip/tools/build/Makefile.build:77: recipe for target
  'plugin_hrtimer.o' failed
  make[3]: *** [plugin_hrtimer.o] Error 2
  Makefile:189: recipe for target 'plugin_hrtimer-in.o' failed
  make[2]: *** [plugin_hrtimer-in.o] Error 2
  Makefile.perf:414: recipe for target 'libtraceevent_plugins' failed
  make[1]: *** [libtraceevent_plugins] Error 2
  make[1]: *** Waiting for unfinished jobs....

Currently we have the install-traceevent-plugins target being dependent
on $(LIBTRACEEVENT), which will actualy not build any plugin. So the
install-traceevent-plugins target itself will try to build plugins,
but..

Plugins built is also triggered by perf build itself via
libtraceevent_plugins target.

This might cause a race having one make thread removing temp files from
another and result in above error. Fixing this by having proper plugins
build dependency before installing plugins.

Reported-and-Tested-by:: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1448546044-28973-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0d19d54..929a32b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -420,7 +420,7 @@ $(LIBTRACEEVENT)-clean:
 	$(call QUIET_CLEAN, libtraceevent)
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
 
-install-traceevent-plugins: $(LIBTRACEEVENT)
+install-traceevent-plugins: libtraceevent_plugins
 	$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
 
 $(LIBAPI): fixdep FORCE

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

* [tip:perf/core] tools build: Use fixdep with OUTPUT path prefix
  2015-11-26 18:50       ` [PATCH] tools build: Use fixdep with OUTPUT path prefix Jiri Olsa
  2015-11-26 19:31         ` Arnaldo Carvalho de Melo
@ 2015-11-27  7:45         ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-11-27  7:45 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, a.p.zijlstra, wangnan0, linux-kernel, acme, jolsa, tglx,
	namhyung, dsahern, mingo, hpa

Commit-ID:  5e50426d5d9049dfdb8b2b18e761717e7e80a6ad
Gitweb:     http://git.kernel.org/tip/5e50426d5d9049dfdb8b2b18e761717e7e80a6ad
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Thu, 26 Nov 2015 19:50:55 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 26 Nov 2015 16:32:24 -0300

tools build: Use fixdep with OUTPUT path prefix

Adding OUTPUT path prefix for fixdep target so we use it properly in out
of tree builds.

If the fixdep already existed in the tree, the out of tree build would
see it already exist and did not build the out of tree version, as
reported by Arnaldo:

  [acme@zoo linux]$ make O=/tmp/build/perf -C tools/perf
  make: Entering directory '/home/git/linux/tools/perf'
    BUILD:   Doing 'make -j4' parallel build
  make[2]: Nothing to be done for 'fixdep'.
  make: Leaving directory '/home/git/linux/tools/perf'

Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20151126185055.GC19410@krava.brq.redhat.com
[ Fixed conflict with 5725dd8fa888 ("tools build: Clean CFLAGS and LDFLAGS for fixdep") ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile         | 2 +-
 tools/build/Makefile.include | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index a930362..0d5a0e3 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -25,7 +25,7 @@ export Q srctree CC LD
 MAKEFLAGS := --no-print-directory
 build     := -f $(srctree)/tools/build/Makefile.build dir=. obj
 
-all: fixdep
+all: $(OUTPUT)fixdep
 
 clean:
 	$(call QUIET_CLEAN, fixdep)
diff --git a/tools/build/Makefile.include b/tools/build/Makefile.include
index 6254760..be630be 100644
--- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include
@@ -4,7 +4,7 @@ ifdef CROSS_COMPILE
 fixdep:
 else
 fixdep:
-	$(Q)$(MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= fixdep
+	$(Q)$(MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep
 endif
 
 .PHONY: fixdep

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

end of thread, other threads:[~2015-11-27  7:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 13:54 [PATCH 1/3] tools build: Introduce features dump include makefile Jiri Olsa
2015-11-26 13:54 ` [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
2015-11-26 16:31   ` Arnaldo Carvalho de Melo
2015-11-26 18:11     ` Jiri Olsa
2015-11-26 18:12     ` Jiri Olsa
2015-11-26 18:50       ` [PATCH] tools build: Use fixdep with OUTPUT path prefix Jiri Olsa
2015-11-26 19:31         ` Arnaldo Carvalho de Melo
2015-11-27  7:45         ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-11-26 13:54 ` [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa
2015-11-26 16:36   ` Arnaldo Carvalho de Melo
2015-11-27  7:44   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-11-26 16:23 ` [PATCH 1/3] tools build: Introduce features dump include makefile 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).