[tip:perf/core] tools/perf/build: Pass through DEBUG parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  fcf92585014f0a0e390d2819de8278ae90da5842
Gitweb:     http://git.kernel.org/tip/fcf92585014f0a0e390d2819de8278ae90da5842
Author:     Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Thu, 10 Oct 2013 08:05:25 +0200
Committer:  Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Mon, 14 Oct 2013 10:29:07 -0300

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@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
 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 9680424..9524c0c 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
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux