aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-10-20 19:19:34 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-21 07:39:57 -0400
commit60d526f7fa6246b8e32d5b45610d625a5608d988 (patch)
treee943b1a366ffee2b7f6de590e3eb688ffc030c82
parentc88e4bf60de6253a048cf4e6b3b0715e543e0460 (diff)
perf tools: Add 'make DEBUG=1' to remove the -O6 cflag
When using gdb to debug perf, it is practically impossible to use when perf is compiled with -O6. For developers, this patch adds the DEBUG feature to the make command line so that a developer can easily remove the optimization flag. LKML-Reference: <1255590330.8392.446.camel@twins> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <20091020232033.984323261@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--tools/perf/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 64c6b7b57d85..65e6e52fe378 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -201,7 +201,14 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
201EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes 201EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
202EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement 202EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
203 203
204CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) 204ifeq ("$(origin DEBUG)", "command line")
205 PERF_DEBUG = $(DEBUG)
206endif
207ifndef PERF_DEBUG
208 CFLAGS_OPTIMIZE = -O6
209endif
210
211CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
205LDFLAGS = -lpthread -lrt -lelf -lm 212LDFLAGS = -lpthread -lrt -lelf -lm
206ALL_CFLAGS = $(CFLAGS) 213ALL_CFLAGS = $(CFLAGS)
207ALL_LDFLAGS = $(LDFLAGS) 214ALL_LDFLAGS = $(LDFLAGS)