path: root/tools
diff options
authorIngo Molnar <>2013-10-02 06:51:27 +0200
committerIngo Molnar <>2013-10-09 08:48:51 +0200
commit31f6be65e08d2cbb876b3b5fc9ae9281b7417c85 (patch)
treefce0d8cb98fa26da6bfa3e91acdd12f23cacbba7 /tools
parentc9404c6650d8f58ce8cf98d4c5581fc5c9e37faf (diff)
tools/perf: Fix double/triple-build of the feature detection logic during 'make install' et al
Linus reported the following perf build system bug: 'Another annoyance during that make was that "make install" seems to want to re-make the thing I just built. That's absolutely horrible, [...]' The thing that got re-built were 'only' the (numerous) feature checks, not the whole project - but still it was mighty annoying as the feature checks took 9+ seconds even on reasonably fast boxes. Even with the autodep patches where feature detection is much faster it wastes resources, wastes screen real estate and confuses users if we execute feature detection twice. There were two sources for these unnecessary re-builds of the feature checks: - Unnecessary nested invocations of $(MAKE), apparently to be able to do conditional compilation dependent on documentation tools presence. Use straight dependencies instead, with no nesting. - A direct invocation of $(MAKE) to rebuild the PERF-VERSION-FILE. This is apparently done to be able to include it into the Makefile: -include $(OUTPUT)PERF-VERSION-FILE but that's entirely pointless for two reasons: 1) the version file gets regenerated by the initial build pass anyway, 2) including it is futile, given its contents: #define PERF_VERSION "3.12.rc3.g8510c7" 'make' will interpret that as a comment line... So just remove this part of the doc-generation logic. With these things fixed a 'make install' now rebuilds only what is needed. A repeated 'make install' on an already built tree is super fast now, it finishes in under 0.3 seconds: # # After the patch: # $ time make install ... real 0m0.280s user 0m0.162s sys 0m0.054s Prior all the autodep changes and prior this fix, a repeat 'make install' took 24.1 seconds (!) on the same system: # # Before the patches: # $ time make install ... real 0m24.109s user 0m21.171s sys 0m2.449s Which almost entirely was caused by fixable build system fat. We are now literally ~86 times faster. A fresh rebuild and install now takes just 11.4 seconds: # # After the patch: # $ make clean $ time make -j16 install ... real 0m11.457s user 1m43.411s sys 0m7.610s Without the patches it took 27.8 seconds: # # Before the patches: # $ make clean $ time make -j16 install ... real 0m27.801s user 1m59.242s sys 0m9.749s So even in the complete rebuild case we are now ~2.5 times faster. Reported-by: Linus Torvalds <> Cc: Arnaldo Carvalho de Melo <> Cc: Peter Zijlstra <> Cc: Namhyung Kim <> Cc: David Ahern <> Cc: Jiri Olsa <> Link: Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'tools')
1 files changed, 4 insertions, 13 deletions
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index 5a37a7c84e69..eaa477f00673 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -192,13 +192,14 @@ do-install-man: man
install-man: check-man-tools man
ifdef missing_tools
- $(warning Please install $(missing_tools) to have the man pages installed)
+ DO_INSTALL_MAN = $(warning Please install $(missing_tools) to have the man pages installed)
- $(MAKE) do-install-man
+ DO_INSTALL_MAN = do-install-man
+try-install-man: $(DO_INSTALL_MAN)
install-info: info
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
$(INSTALL) -m 644 $(OUTPUT) $(OUTPUT) $(DESTDIR)$(infodir)
@@ -216,14 +217,6 @@ install-pdf: pdf
#install-html: html
# '$(SHELL_PATH_SQ)' ./ $(DESTDIR)$(htmldir)
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),tags)
# Determine "include::" file references in asciidoc files.
@@ -342,5 +335,3 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
# '$(SHELL_PATH_SQ)' ./ $(HTML_REF) $(DESTDIR)$(htmldir)