diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-10-01 11:17:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 02:48:51 -0400 |
commit | c9404c6650d8f58ce8cf98d4c5581fc5c9e37faf (patch) | |
tree | 0021feef6ccedb28e875340ed364b5b87f0fa839 /tools/perf/Makefile | |
parent | c72e3f04b45fb2e50cdd81a50c3778c6a57251d8 (diff) |
tools/perf/build: Speed up the final link
libtraceevent.a and liblk.a rules have always-missed dependencies,
which causes python.so to be relinked at every build attempt - even
if none of the affected code changes.
This slows down re-builds unnecessarily, by adding more than a second
to the build time:
comet:~/tip/tools/perf> time make
...
SUBDIR /fast/mingo/tip/tools/lib/lk/
make[1]: `liblk.a' is up to date.
SUBDIR /fast/mingo/tip/tools/lib/traceevent/
LINK perf
GEN python/perf.so
real 0m1.701s
user 0m1.338s
sys 0m0.301s
Add the (trivial) dependencies to not force a re-link.
This speeds up an empty re-build enormously:
comet:~/tip/tools/perf> time make
...
real 0m0.207s
user 0m0.134s
sys 0m0.028s
[ This adds some coupling between the build dependencies of
libtraceevent and liblk - but until those stay relatively
simple this should not be an issue. ]
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-wvmlrurufuk6mo1ovtNigguT@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 6b5452a120af..df76198d45d4 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -669,15 +669,19 @@ $(LIB_FILE): $(LIB_OBJS) | |||
669 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) | 669 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) |
670 | 670 | ||
671 | # libtraceevent.a | 671 | # libtraceevent.a |
672 | $(LIBTRACEEVENT): | 672 | TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch]) |
673 | |||
674 | $(LIBTRACEEVENT): $(TE_SOURCES) | ||
673 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a | 675 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a |
674 | 676 | ||
675 | $(LIBTRACEEVENT)-clean: | 677 | $(LIBTRACEEVENT)-clean: |
676 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean | 678 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean |
677 | 679 | ||
680 | LIBLK_SOURCES = $(wildcard $(LK_PATH)*.[ch]) | ||
681 | |||
678 | # if subdir is set, we've been called from above so target has been built | 682 | # if subdir is set, we've been called from above so target has been built |
679 | # already | 683 | # already |
680 | $(LIBLK): | 684 | $(LIBLK): $(LIBLK_SOURCES) |
681 | ifeq ($(subdir),) | 685 | ifeq ($(subdir),) |
682 | $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a | 686 | $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a |
683 | endif | 687 | endif |
@@ -825,6 +829,6 @@ else | |||
825 | GIT-HEAD-PHONY = | 829 | GIT-HEAD-PHONY = |
826 | endif | 830 | endif |
827 | 831 | ||
828 | .PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) | 832 | .PHONY: all install clean strip |
829 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell | 833 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
830 | .PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS | 834 | .PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope .FORCE-PERF-CFLAGS |