From 0be314c20742cd62cd6e8fcfbcc4535fb2a99675 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 4 Jul 2014 16:43:48 -0700 Subject: Use BASIC_FLAGS for profile feedback Use BASIC_CFLAGS instead of CFLAGS to set up the profile feedback option in the Makefile. This allows still overriding CFLAGS on the make command line without disabling profile feedback. Signed-off-by: Andi Kleen Signed-off-by: Junio C Hamano --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 07ea105837..a9770ac476 100644 --- a/Makefile +++ b/Makefile @@ -1552,13 +1552,13 @@ endif PROFILE_DIR := $(CURDIR) ifeq ("$(PROFILE)","GEN") - CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1 + BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1 EXTLIBS += -lgcov export CCACHE_DISABLE = t V = 1 else ifneq ("$(PROFILE)","") - CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1 + BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1 export CCACHE_DISABLE = t V = 1 endif -- cgit v1.2.3 From 5d7fd6d06feb29acc9e6304a75b4e26eb23491c4 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 7 Jul 2014 23:35:10 -0700 Subject: Run the perf test suite for profile feedback too Signed-off-by: Andi Kleen Signed-off-by: Junio C Hamano --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a9770ac476..ba64be9fb2 100644 --- a/Makefile +++ b/Makefile @@ -1647,6 +1647,7 @@ ifeq ($(filter all,$(MAKECMDGOALS)),all) all:: profile-clean $(MAKE) PROFILE=GEN all $(MAKE) PROFILE=GEN -j1 test + $(MAKE) PROFILE=GEN -j1 perf endif endif -- cgit v1.2.3 From 066dd2632acf11a348ff209b79f42c1a87a71fbb Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 7 Jul 2014 23:35:11 -0700 Subject: Fix profile feedback with -jN and add profile-fast Profile feedback always failed for me with -jN. The problem was that there was no implicit ordering between the profile generate stage and the profile use stage. So some objects in the later stage would be linked with profile generate objects, and fail due to the missing -lgcov. This adds a new profile target that implicitely enforces the correct ordering by using submakes. Plus a profile-install target to also install. This is also nicer to type that PROFILE=... Plus I always run the performance test suite now for the full profile run. In addition I also added a profile-fast / profile-fast-install target the only runs the performance test suite instead of the whole test suite. This significantly speeds up the profile build, which was totally dominated by test suite run time. However it may have less coverage of course. Signed-off-by: Andi Kleen Signed-off-by: Junio C Hamano --- Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ba64be9fb2..a760402370 100644 --- a/Makefile +++ b/Makefile @@ -1643,13 +1643,20 @@ SHELL = $(SHELL_PATH) all:: shell_compatibility_test ifeq "$(PROFILE)" "BUILD" -ifeq ($(filter all,$(MAKECMDGOALS)),all) -all:: profile-clean +all:: profile +endif + +profile:: profile-clean $(MAKE) PROFILE=GEN all $(MAKE) PROFILE=GEN -j1 test $(MAKE) PROFILE=GEN -j1 perf -endif -endif + $(MAKE) PROFILE=USE all + +profile-fast: profile-clean + $(MAKE) PROFILE=GEN all + $(MAKE) PROFILE=GEN -j1 perf + $(MAKE) PROFILE=USE all + all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS ifneq (,$X) @@ -2336,6 +2343,12 @@ mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir)) install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X) +profile-install: profile + $(MAKE) install + +profile-fast-install: profile-fast + $(MAKE) install + install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' -- cgit v1.2.3