LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>,
Alexis Berlemont <alexis.berlemont@gmail.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 06/36] perf build: Add bench objects building
Date: Thu, 15 Jan 2015 13:55:02 +0100 [thread overview]
Message-ID: <1421326532-25660-7-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1421326532-25660-1-git-send-email-jolsa@kernel.org>
Move bench objects building under build framework
and enable perf-in.o rule.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
---
tools/perf/Build | 2 ++
tools/perf/Makefile.perf | 38 ++++++++++++++++----------------------
tools/perf/bench/Build | 11 +++++++++++
tools/perf/config/Makefile | 2 ++
4 files changed, 31 insertions(+), 22 deletions(-)
create mode 100644 tools/perf/Build
create mode 100644 tools/perf/bench/Build
diff --git a/tools/perf/Build b/tools/perf/Build
new file mode 100644
index 000000000000..9ea828de3fde
--- /dev/null
+++ b/tools/perf/Build
@@ -0,0 +1,2 @@
+perf-y += builtin-bench.o
+perf-y += bench/
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index dd49b40e203b..8f50d0c45307 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -93,6 +93,7 @@ $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
@touch $(OUTPUT)PERF-VERSION-FILE
CC = $(CROSS_COMPILE)gcc
+LD = $(CROSS_COMPILE)ld
AR = $(CROSS_COMPILE)ar
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
@@ -462,21 +463,6 @@ LIB_OBJS += $(OUTPUT)tests/thread-mg-share.o
LIB_OBJS += $(OUTPUT)tests/switch-tracking.o
BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
-BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
-# Benchmark modules
-BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
-BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
-ifeq ($(ARCH), x86)
-ifeq ($(IS_64_BIT), 1)
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
-endif
-endif
-BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
-BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
-
BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
BUILTIN_OBJS += $(OUTPUT)builtin-help.o
@@ -595,10 +581,6 @@ ifeq ($(NO_PERF_REGS),0)
LIB_OBJS += $(OUTPUT)util/perf_regs.o
endif
-ifndef NO_LIBNUMA
- BUILTIN_OBJS += $(OUTPUT)bench/numa.o
-endif
-
ifndef NO_ZLIB
LIB_OBJS += $(OUTPUT)util/zlib.o
endif
@@ -625,14 +607,22 @@ shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
strip: $(PROGRAMS) $(OUTPUT)perf
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
+PERF_IN := $(OUTPUT)perf-in.o
+
+export srctree OUTPUT RM CC LD CFLAGS V
+build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+
+$(PERF_IN): FORCE
+ @$(MAKE) $(build)=perf
+
$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
$(CFLAGS) -c $(filter %.c,$^) -o $@
-$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
+$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
- $(BUILTIN_OBJS) $(LIBS) -o $@
+ $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@
$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H)
$(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
@@ -984,6 +974,8 @@ config-clean:
clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
+ @find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM)
+ @$(RM) .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)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
@@ -999,7 +991,9 @@ else
GIT-HEAD-PHONY =
endif
+FORCE:
+
.PHONY: all install clean config-clean strip install-gtk
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
-.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS
+.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS FORCE
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build
new file mode 100644
index 000000000000..5ce98023d518
--- /dev/null
+++ b/tools/perf/bench/Build
@@ -0,0 +1,11 @@
+perf-y += sched-messaging.o
+perf-y += sched-pipe.o
+perf-y += mem-memcpy.o
+perf-y += futex-hash.o
+perf-y += futex-wake.o
+perf-y += futex-requeue.o
+
+perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
+perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
+
+perf-$(CONFIG_NUMA) += numa.o
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index bd60ca04d5da..1938432969ab 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -28,6 +28,7 @@ ifeq ($(ARCH),x86)
CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
+ $(call detected,CONFIG_X86_64)
else
LIBUNWIND_LIBS = -lunwind -lunwind-x86
endif
@@ -633,6 +634,7 @@ ifndef NO_LIBNUMA
else
CFLAGS += -DHAVE_LIBNUMA_SUPPORT
EXTLIBS += -lnuma
+ $(call detected,CONFIG_NUMA)
endif
endif
--
1.9.3
next prev parent reply other threads:[~2015-01-15 12:56 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 12:54 [PATCHv2 00/36] perf tools: New build framework Jiri Olsa
2015-01-15 12:54 ` [PATCH 01/36] tools build: Add new build support Jiri Olsa
2015-01-15 12:54 ` [PATCH 02/36] tools build: Add detected config support Jiri Olsa
2015-01-15 15:50 ` David Ahern
2015-01-15 16:21 ` Jiri Olsa
2015-01-15 12:54 ` [PATCH 03/36] tools build: Add subdir support Jiri Olsa
2015-01-15 12:55 ` [PATCH 04/36] perf tools: Remove api fs object from python build Jiri Olsa
2015-01-15 12:55 ` [PATCH 05/36] perf build: Disable make's built-in rules and variables Jiri Olsa
2015-01-15 16:01 ` David Ahern
2015-01-15 16:24 ` Jiri Olsa
2015-01-15 12:55 ` Jiri Olsa [this message]
2015-01-15 12:55 ` [PATCH 07/36] perf build: Add tests objects building Jiri Olsa
2015-01-15 12:55 ` [PATCH 08/36] perf build: Add builtin " Jiri Olsa
2015-01-15 12:55 ` [PATCH 09/36] perf build: Add libperf " Jiri Olsa
2015-01-15 12:55 ` [PATCH 10/36] perf build: Add probe " Jiri Olsa
2015-01-15 12:55 ` [PATCH 11/36] perf build: Add dwarf " Jiri Olsa
2015-01-15 12:55 ` [PATCH 12/36] perf build: Add dwarf unwind " Jiri Olsa
2015-01-15 12:55 ` [PATCH 13/36] perf build: Add ui " Jiri Olsa
2015-01-15 12:55 ` [PATCH 14/36] perf build: Add slang " Jiri Olsa
2015-01-15 12:55 ` [PATCH 15/36] perf build: Add gtk " Jiri Olsa
2015-01-15 12:55 ` [PATCH 16/36] perf build: Add scripts " Jiri Olsa
2015-01-15 12:55 ` [PATCH 17/36] perf build: Add perf regs " Jiri Olsa
2015-01-15 12:55 ` [PATCH 18/36] perf build: Add zlib " Jiri Olsa
2015-01-15 12:55 ` [PATCH 19/36] perf build: Add perf.o object building Jiri Olsa
2015-01-15 12:55 ` [PATCH 20/36] perf build: Add arch x86 objects building Jiri Olsa
2015-01-15 12:55 ` [PATCH 21/36] perf build: Add arch arm " Jiri Olsa
2015-01-15 12:55 ` [PATCH 22/36] perf build: Add arch arm64 " Jiri Olsa
2015-01-15 12:55 ` [PATCH 23/36] perf build: Add arch powerpc " Jiri Olsa
2015-01-15 12:55 ` [PATCH 24/36] perf build: Add arch s390 " Jiri Olsa
2015-01-15 12:55 ` [PATCH 25/36] perf build: Add arch sh " Jiri Olsa
2015-01-15 12:55 ` [PATCH 26/36] perf build: Add arch sparc " Jiri Olsa
2015-01-15 12:55 ` [PATCH 27/36] perf build: Add single target build framework support Jiri Olsa
2015-01-15 12:55 ` [PATCH 28/36] perf build: Remove directory dependency rules Jiri Olsa
2015-01-15 12:55 ` [PATCH 29/36] perf build: Remove uneeded variables Jiri Olsa
2015-01-15 12:55 ` [PATCH 30/36] perf build: Remove PERF-CFLAGS file Jiri Olsa
2015-01-15 12:55 ` [PATCH 31/36] perf build: Add build documentation Jiri Olsa
2015-01-15 12:55 ` [PATCH 32/36] tools lib api: Use tools build framework Jiri Olsa
2015-01-15 12:55 ` [PATCH 33/36] tools lib api: Rename libapikfs.a to libapi.a Jiri Olsa
2015-01-15 12:55 ` [PATCH 34/36] tools lib traceevent: Use tools build framework Jiri Olsa
2015-01-15 12:55 ` [PATCH 35/36] tools lib lockdep: " Jiri Olsa
2015-01-15 12:55 ` [PATCH 36/36] perf build: Display make commands on V=1 Jiri Olsa
2015-01-15 16:08 ` [PATCHv2 00/36] perf tools: New build framework David Ahern
2015-01-15 16:31 ` Jiri Olsa
2015-01-16 11:39 ` Will Deacon
2015-01-16 12:12 ` Mark Rutland
2015-01-16 12:22 ` Will Deacon
2015-01-16 12:30 ` Jiri Olsa
2015-01-16 12:43 ` Jiri Olsa
2015-01-16 13:41 ` Will Deacon
2015-01-16 13:49 ` Mark Rutland
2015-01-16 14:15 ` Jiri Olsa
2015-01-19 12:13 ` Jiri Olsa
2015-01-16 12:29 ` Jiri Olsa
2015-01-20 16:38 [PATCHv3 " Jiri Olsa
2015-01-20 16:39 ` [PATCH 06/36] perf build: Add bench objects building Jiri Olsa
2015-01-26 10:12 [PATCHv4 00/36] perf tools: New build framework Jiri Olsa
2015-01-26 10:12 ` [PATCH 06/36] perf build: Add bench objects building Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421326532-25660-7-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=acme@redhat.com \
--cc=alexis.berlemont@gmail.com \
--cc=bp@alien8.de \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--subject='Re: [PATCH 06/36] perf build: Add bench objects building' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).