lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Nov 2015 11:28:55 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
	Jan Kratochvil <jkratoch@...hat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Milian Wolff <milian.wolff@...b.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Taeung Song <treeze.taeung@...il.com>,
	Wang Nan <wangnan0@...wei.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [GIT PULL 0/7] perf/core improvements and fixes

On Tue, Nov 24, 2015 at 09:10:42AM +0100, Ingo Molnar wrote:

SNIP

> >  tools/perf/util/unwind-libdw.c           |  53 +++++++++++-----
> >  tools/perf/util/unwind-libdw.h           |   2 +
> >  tools/perf/util/unwind-libunwind.c       |  60 +++++++++++-------
> >  11 files changed, 272 insertions(+), 39 deletions(-)
> >  create mode 100644 tools/perf/Documentation/perf-config.txt
> >  create mode 100644 tools/perf/builtin-config.c
> 
> Hm, I noticed something weird - I think it started with this pull request - the 
> feature detection build messages come mixed with the regular build:
> 
> triton:~/tip/tools/perf> make
>   BUILD:   Doing 'make -j12' parallel build
> 
> Auto-detecting system features:
> ...                         dwarf: [ on  ]
> ...                         glibc: [ on  ]
> ...                          gtk2: [ on  ]
> ...                      libaudit: [ on  ]
> ...                        libbfd: [ on  ]
> ...                        libelf: [ on  ]
> ...                       libnuma: [ on  ]
> ...        numa_num_possible_cpus: [ on  ]
> ...                       libperl: [ on  ]
> ...                     libpython: [ on  ]
> ...                      libslang: [ on  ]
> ...                     libunwind: [ on  ]
> ...            libdw-dwarf-unwind: [ on  ]
> ...                          zlib: [ on  ]
> ...                          lzma: [ on  ]
> ...                     get_cpuid: [ on  ]
> ...                           bpf: [ on  ]
> 
>   GEN      common-cmds.h
>   CC       perf-read-vdso32
>   CC       perf-read-vdsox32
>   CC       ui/gtk/browser.o
>   CC       ui/gtk/hists.o
>   CC       ui/gtk/setup.o
>   CC       ui/gtk/util.o
>   CC       ui/gtk/helpline.o
>   CC       ui/gtk/progress.o
>   CC       ui/gtk/annotate.o
>   CC       util/abspath.o
>   CC       fd/array.o
> 
> Auto-detecting system features:
>   CC       event-parse.o
> ...                        libelf: [ on  ]
>   PERF_VERSION = 4.4.rc2.g9327ca
> ...                           bpf: [ on  ]
> 
>   CC       util/alias.o
>   CC       libbpf.o


so how about we let perf do the overall checking and propagate
that via include file that will setup feature-$(feature) variables

if bpf is built by perf, perf passes this makefile include path
and bpf includes it.. otherwise it runs the standard detection

please test attached patch (bpf guys mainly ;-) )

if that works for you, I'll clean it up a bit and post

thanks,
jirka


---
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 37ff4c9f92f1..a8a65ff010a4 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -131,6 +131,8 @@ ifeq ($(dwarf-post-unwind),1)
   FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
 endif
 
+FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER).include
+
 # The $(feature_display) controls the default detection message
 # output. It's set if:
 # - detected features differes from stored features from
@@ -140,6 +142,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/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index a3caaf3eafbd..0177bf81f826 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 $(srctree)/tools/build/Makefile.feature
+else
+include $(FEATURES)
+endif
 
 export prefix libdir src obj
 
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 929a32ba15f5..4f18c1210509 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=$(realpath $(OUTPUT)FEATURE-DUMP.include)
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ