From: Ingo Molnar <mingo@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: [PATCH] tools/perf/build: Pass through DEBUG parameter
Date: Thu, 10 Oct 2013 08:10:48 +0200 [thread overview]
Message-ID: <20131010061048.GB23716@gmail.com> (raw)
In-Reply-To: <20131009191626.GD28369@ghostprotocols.net>
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>
---
tools/perf/Makefile | 15 ++++++++++++++-
tools/perf/config/Makefile | 7 ++-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 9147044..4835618 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -37,12 +37,25 @@ ifneq ($(O),)
FULL_O := $(shell readlink -f $(O) || echo $(O))
endif
+#
+# Only accept the 'DEBUG' variable from the command line:
+#
+ifeq ("$(origin DEBUG)", "command line")
+ ifeq ($(DEBUG),)
+ override DEBUG = 0
+ else
+ SET_DEBUG = "DEBUG=$(DEBUG)"
+ endif
+else
+ override DEBUG = 0
+endif
+
define print_msg
@printf ' BUILD: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build\n'
endef
define make
- @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $@
+ @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
endef
#
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f5d661f..3227107 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -66,10 +66,7 @@ ifneq ($(WERROR),0)
CFLAGS += -Werror
endif
-ifeq ("$(origin DEBUG)", "command line")
- PERF_DEBUG = $(DEBUG)
-endif
-ifndef PERF_DEBUG
+ifeq ($(DEBUG),0)
CFLAGS += -O6
endif
@@ -210,7 +207,7 @@ ifeq ($(feature-volatile-register-var), 1)
CFLAGS += -Wvolatile-register-var
endif
-ifndef PERF_DEBUG
+ifeq ($(DEBUG),0)
ifeq ($(feature-fortify-source), 1)
CFLAGS += -D_FORTIFY_SOURCE=2
endif
next prev parent reply other threads:[~2013-10-10 6:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 7:01 [GIT PULL] tools/perf/build: Speed up the perf build system Ingo Molnar
2013-10-09 14:38 ` Arnaldo Carvalho de Melo
2013-10-09 14:51 ` Ingo Molnar
2013-10-09 15:00 ` [PATCH] tools/perf/build: Fix non-existent build directory handling Ingo Molnar
2013-10-15 5:33 ` [tip:perf/core] " tip-bot for Ingo Molnar
2013-10-09 19:16 ` [GIT PULL] tools/perf/build: Speed up the perf build system Arnaldo Carvalho de Melo
2013-10-09 19:38 ` Arnaldo Carvalho de Melo
2013-10-10 5:42 ` [PATCH] tools/perf/build: Fix redirection printouts Ingo Molnar
2013-10-15 5:31 ` [tip:perf/core] perf tools: " tip-bot for Ingo Molnar
2013-10-10 6:10 ` Ingo Molnar [this message]
2013-10-10 19:26 ` [GIT PULL] tools/perf/build: Speed up the perf build system Arnaldo Carvalho de Melo
2013-10-10 19:50 ` Arnaldo Carvalho de Melo
2013-10-10 20:06 ` Arnaldo Carvalho de Melo
2013-10-10 22:13 ` Jiri Olsa
2013-10-10 22:29 ` David Ahern
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=20131010061048.GB23716@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox