Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278236 > unrolled thread

[PATCH 1/3] tools build: Introduce features dump include makefile

Started byJiri Olsa <jolsa@kernel.org>
First post2015-11-26 15:00 +0100
Last post2015-11-26 17:30 +0100
Articles 12 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] tools build: Introduce features dump include makefile Jiri Olsa <jolsa@kernel.org> - 2015-11-26 15:00 +0100
    [PATCH 3/3] perf build: Fix traceevent plugins build race Jiri Olsa <jolsa@kernel.org> - 2015-11-26 15:00 +0100
      Re: [PATCH 3/3] perf build: Fix traceevent plugins build race Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-26 17:40 +0100
      [tip:perf/core] perf build: Fix traceevent plugins build race tip-bot for Jiri Olsa <tipbot@zytor.com> - 2015-11-27 08:50 +0100
    [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa <jolsa@kernel.org> - 2015-11-26 15:00 +0100
      Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-26 17:40 +0100
        Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa <jolsa@redhat.com> - 2015-11-26 19:20 +0100
        Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa <jolsa@redhat.com> - 2015-11-26 19:20 +0100
          [PATCH] tools build: Use fixdep with OUTPUT path prefix Jiri Olsa <jolsa@redhat.com> - 2015-11-26 20:00 +0100
            Re: [PATCH] tools build: Use fixdep with OUTPUT path prefix Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-26 20:40 +0100
            [tip:perf/core] tools build: Use fixdep with OUTPUT path prefix tip-bot for Jiri Olsa <tipbot@zytor.com> - 2015-11-27 08:50 +0100
    Re: [PATCH 1/3] tools build: Introduce features dump include makefile Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-11-26 17:30 +0100

#1278236 — [PATCH 1/3] tools build: Introduce features dump include makefile

FromJiri Olsa <jolsa@kernel.org>
Date2015-11-26 15:00 +0100
Subject[PATCH 1/3] tools build: Introduce features dump include makefile
Message-ID<qz5fB-5UD-21@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1278237 — [PATCH 3/3] perf build: Fix traceevent plugins build race

FromJiri Olsa <jolsa@kernel.org>
Date2015-11-26 15:00 +0100
Subject[PATCH 3/3] perf build: Fix traceevent plugins build race
Message-ID<qz5fB-5UD-19@gated-at.bofh.it>
In reply to#1278236
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278332 — Re: [PATCH 3/3] perf build: Fix traceevent plugins build race

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-11-26 17:40 +0100
SubjectRe: [PATCH 3/3] perf build: Fix traceevent plugins build race
Message-ID<qz7Kq-7Fr-15@gated-at.bofh.it>
In reply to#1278237
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278597 — [tip:perf/core] perf build: Fix traceevent plugins build race

Fromtip-bot for Jiri Olsa <tipbot@zytor.com>
Date2015-11-27 08:50 +0100
Subject[tip:perf/core] perf build: Fix traceevent plugins build race
Message-ID<qzlX5-8k4-39@gated-at.bofh.it>
In reply to#1278237
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278240 — [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject

FromJiri Olsa <jolsa@kernel.org>
Date2015-11-26 15:00 +0100
Subject[PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
Message-ID<qz5fB-5UD-27@gated-at.bofh.it>
In reply to#1278236
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278334 — Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-11-26 17:40 +0100
SubjectRe: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
Message-ID<qz7Kq-7Fr-21@gated-at.bofh.it>
In reply to#1278240
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278386 — Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject

FromJiri Olsa <jolsa@redhat.com>
Date2015-11-26 19:20 +0100
SubjectRe: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
Message-ID<qz9jc-ky-11@gated-at.bofh.it>
In reply to#1278334
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278388 — Re: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject

FromJiri Olsa <jolsa@redhat.com>
Date2015-11-26 19:20 +0100
SubjectRe: [PATCH 2/3] perf build: Use FEATURE-INCLUDE in bpf subproject
Message-ID<qz9jc-ky-19@gated-at.bofh.it>
In reply to#1278334
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278398 — [PATCH] tools build: Use fixdep with OUTPUT path prefix

FromJiri Olsa <jolsa@redhat.com>
Date2015-11-26 20:00 +0100
Subject[PATCH] tools build: Use fixdep with OUTPUT path prefix
Message-ID<qz9VU-xL-17@gated-at.bofh.it>
In reply to#1278388
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278407 — Re: [PATCH] tools build: Use fixdep with OUTPUT path prefix

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-11-26 20:40 +0100
SubjectRe: [PATCH] tools build: Use fixdep with OUTPUT path prefix
Message-ID<qzayB-ZY-1@gated-at.bofh.it>
In reply to#1278398
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278598 — [tip:perf/core] tools build: Use fixdep with OUTPUT path prefix

Fromtip-bot for Jiri Olsa <tipbot@zytor.com>
Date2015-11-27 08:50 +0100
Subject[tip:perf/core] tools build: Use fixdep with OUTPUT path prefix
Message-ID<qzlX5-8k4-43@gated-at.bofh.it>
In reply to#1278398
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1278322

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-11-26 17:30 +0100
Message-ID<qz7AK-7Bz-9@gated-at.bofh.it>
In reply to#1278236
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web