aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-10-10 02:05:25 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-14 09:29:07 -0400
commitfcf92585014f0a0e390d2819de8278ae90da5842 (patch)
tree2bc7eb7876b8d5d79959bb078cde774ccc428e94 /tools/perf/Makefile
parent3fb66335e13ef7426affe9efa48c08857202c1cb (diff)
tools/perf/build: Pass through DEBUG parameter
Arnaldo reported that 'make DEBUG=1' does not work anymore. The reason is that 'Makefile' only passes it through to 'Makefile.perf' via the environment, but 'Makefile.perf' checks that it's a command line option: ifeq ("$(origin DEBUG)", "command line") PERF_DEBUG = $(DEBUG) endif So pass it through properly, and also clean up DEBUG parameter handling while at it and fix a couple of annoyances: - DEBUG=0 used to be interpreted as 'debugging on'. Turn it into 'debugging off' instead. - Same was the case for 'DEBUG=' - turn that into debug-off as well. - Pass in just a clean, sanitized 'DEBUG' value and get rid of the intermediate, unnecessary PERF_DEBUG variable. Reported-by: 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> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 914704495166..4835618a5608 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -37,12 +37,25 @@ ifneq ($(O),)
37 FULL_O := $(shell readlink -f $(O) || echo $(O)) 37 FULL_O := $(shell readlink -f $(O) || echo $(O))
38endif 38endif
39 39
40#
41# Only accept the 'DEBUG' variable from the command line:
42#
43ifeq ("$(origin DEBUG)", "command line")
44 ifeq ($(DEBUG),)
45 override DEBUG = 0
46 else
47 SET_DEBUG = "DEBUG=$(DEBUG)"
48 endif
49else
50 override DEBUG = 0
51endif
52
40define print_msg 53define print_msg
41 @printf ' BUILD: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build\n' 54 @printf ' BUILD: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build\n'
42endef 55endef
43 56
44define make 57define make
45 @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $@ 58 @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
46endef 59endef
47 60
48# 61#