summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-04-14 22:06:58 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-30 09:46:48 -0400
commit8e1b3f68684c51c96df2a71b5e16167b43e5daa0 (patch)
tree5185cadbf65e0967d30a611e242360ad95330dae
parent4e22db46495f951d3b652277047639ea60c89d3c (diff)
perf tools: Replace tabs with spaces for all non-commands statements
Replacing tabs with spaces for all non-commands statements in 'Makefile' and 'config/Makefile' files. Suggested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1369398928-9809-23-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Makefile80
-rw-r--r--tools/perf/config/Makefile396
2 files changed, 238 insertions, 238 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 8f50afe09c02..ac52598e0f5a 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -124,14 +124,14 @@ strip-libs = $(filter-out -l%,$(1))
124LK_PATH=$(LK_DIR) 124LK_PATH=$(LK_DIR)
125 125
126ifneq ($(OUTPUT),) 126ifneq ($(OUTPUT),)
127 TE_PATH=$(OUTPUT) 127 TE_PATH=$(OUTPUT)
128ifneq ($(subdir),) 128ifneq ($(subdir),)
129 LK_PATH=$(OUTPUT)$(LK_DIR) 129 LK_PATH=$(OUTPUT)$(LK_DIR)
130else 130else
131 LK_PATH=$(OUTPUT) 131 LK_PATH=$(OUTPUT)
132endif 132endif
133else 133else
134 TE_PATH=$(TRACE_EVENT_DIR) 134 TE_PATH=$(TRACE_EVENT_DIR)
135endif 135endif
136 136
137LIBTRACEEVENT = $(TE_PATH)libtraceevent.a 137LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -175,10 +175,10 @@ OTHER_PROGRAMS = $(OUTPUT)perf
175 175
176# Set paths to tools early so that they can be used for version tests. 176# Set paths to tools early so that they can be used for version tests.
177ifndef SHELL_PATH 177ifndef SHELL_PATH
178 SHELL_PATH = /bin/sh 178 SHELL_PATH = /bin/sh
179endif 179endif
180ifndef PERL_PATH 180ifndef PERL_PATH
181 PERL_PATH = /usr/bin/perl 181 PERL_PATH = /usr/bin/perl
182endif 182endif
183 183
184export PERL_PATH 184export PERL_PATH
@@ -433,7 +433,7 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
433-include arch/$(ARCH)/Makefile 433-include arch/$(ARCH)/Makefile
434 434
435ifneq ($(OUTPUT),) 435ifneq ($(OUTPUT),)
436 CFLAGS += -I$(OUTPUT) 436 CFLAGS += -I$(OUTPUT)
437endif 437endif
438 438
439ifdef NO_LIBELF 439ifdef NO_LIBELF
@@ -452,67 +452,67 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
452 452
453else # NO_LIBELF 453else # NO_LIBELF
454ifndef NO_DWARF 454ifndef NO_DWARF
455 LIB_OBJS += $(OUTPUT)util/probe-finder.o 455 LIB_OBJS += $(OUTPUT)util/probe-finder.o
456 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o 456 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
457endif # NO_DWARF 457endif # NO_DWARF
458endif # NO_LIBELF 458endif # NO_LIBELF
459 459
460ifndef NO_LIBUNWIND 460ifndef NO_LIBUNWIND
461 LIB_OBJS += $(OUTPUT)util/unwind.o 461 LIB_OBJS += $(OUTPUT)util/unwind.o
462endif 462endif
463 463
464ifndef NO_LIBAUDIT 464ifndef NO_LIBAUDIT
465 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o 465 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
466endif 466endif
467 467
468ifndef NO_SLANG 468ifndef NO_SLANG
469 LIB_OBJS += $(OUTPUT)ui/browser.o 469 LIB_OBJS += $(OUTPUT)ui/browser.o
470 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o 470 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
471 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o 471 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
472 LIB_OBJS += $(OUTPUT)ui/browsers/map.o 472 LIB_OBJS += $(OUTPUT)ui/browsers/map.o
473 LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o 473 LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
474 LIB_OBJS += $(OUTPUT)ui/tui/setup.o 474 LIB_OBJS += $(OUTPUT)ui/tui/setup.o
475 LIB_OBJS += $(OUTPUT)ui/tui/util.o 475 LIB_OBJS += $(OUTPUT)ui/tui/util.o
476 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o 476 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
477 LIB_OBJS += $(OUTPUT)ui/tui/progress.o 477 LIB_OBJS += $(OUTPUT)ui/tui/progress.o
478 LIB_H += ui/browser.h 478 LIB_H += ui/browser.h
479 LIB_H += ui/browsers/map.h 479 LIB_H += ui/browsers/map.h
480 LIB_H += ui/keysyms.h 480 LIB_H += ui/keysyms.h
481 LIB_H += ui/libslang.h 481 LIB_H += ui/libslang.h
482endif 482endif
483 483
484ifndef NO_GTK2 484ifndef NO_GTK2
485 LIB_OBJS += $(OUTPUT)ui/gtk/browser.o 485 LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
486 LIB_OBJS += $(OUTPUT)ui/gtk/hists.o 486 LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
487 LIB_OBJS += $(OUTPUT)ui/gtk/setup.o 487 LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
488 LIB_OBJS += $(OUTPUT)ui/gtk/util.o 488 LIB_OBJS += $(OUTPUT)ui/gtk/util.o
489 LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o 489 LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
490 LIB_OBJS += $(OUTPUT)ui/gtk/progress.o 490 LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
491 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o 491 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
492endif 492endif
493 493
494ifndef NO_LIBPERL 494ifndef NO_LIBPERL
495 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o 495 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
496 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o 496 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
497endif 497endif
498 498
499ifndef NO_LIBPYTHON 499ifndef NO_LIBPYTHON
500 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o 500 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
501 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o 501 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
502endif 502endif
503 503
504ifeq ($(NO_PERF_REGS),0) 504ifeq ($(NO_PERF_REGS),0)
505 ifeq ($(ARCH),x86) 505 ifeq ($(ARCH),x86)
506 LIB_H += arch/x86/include/perf_regs.h 506 LIB_H += arch/x86/include/perf_regs.h
507 endif 507 endif
508endif 508endif
509 509
510ifndef NO_LIBNUMA 510ifndef NO_LIBNUMA
511 BUILTIN_OBJS += $(OUTPUT)bench/numa.o 511 BUILTIN_OBJS += $(OUTPUT)bench/numa.o
512endif 512endif
513 513
514ifdef ASCIIDOC8 514ifdef ASCIIDOC8
515 export ASCIIDOC8 515 export ASCIIDOC8
516endif 516endif
517 517
518LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group 518LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index cc464f12354e..976599319c6e 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -1,37 +1,37 @@
1uname_M := $(shell uname -m 2>/dev/null || echo not) 1uname_M := $(shell uname -m 2>/dev/null || echo not)
2 2
3ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ 3ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
4 -e s/arm.*/arm/ -e s/sa110/arm/ \ 4 -e s/arm.*/arm/ -e s/sa110/arm/ \
5 -e s/s390x/s390/ -e s/parisc64/parisc/ \ 5 -e s/s390x/s390/ -e s/parisc64/parisc/ \
6 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ 6 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
7 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) 7 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
8NO_PERF_REGS := 1 8NO_PERF_REGS := 1
9CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) 9CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
10 10
11# Additional ARCH settings for x86 11# Additional ARCH settings for x86
12ifeq ($(ARCH),i386) 12ifeq ($(ARCH),i386)
13 override ARCH := x86 13 override ARCH := x86
14 NO_PERF_REGS := 0 14 NO_PERF_REGS := 0
15 LIBUNWIND_LIBS = -lunwind -lunwind-x86 15 LIBUNWIND_LIBS = -lunwind -lunwind-x86
16endif 16endif
17 17
18ifeq ($(ARCH),x86_64) 18ifeq ($(ARCH),x86_64)
19 override ARCH := x86 19 override ARCH := x86
20 IS_X86_64 := 0 20 IS_X86_64 := 0
21 ifeq (, $(findstring m32,$(CFLAGS))) 21 ifeq (, $(findstring m32,$(CFLAGS)))
22 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) 22 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
23 endif 23 endif
24 ifeq (${IS_X86_64}, 1) 24 ifeq (${IS_X86_64}, 1)
25 RAW_ARCH := x86_64 25 RAW_ARCH := x86_64
26 CFLAGS += -DARCH_X86_64 26 CFLAGS += -DARCH_X86_64
27 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S 27 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
28 endif 28 endif
29 NO_PERF_REGS := 0 29 NO_PERF_REGS := 0
30 LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 30 LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
31endif 31endif
32 32
33ifeq ($(NO_PERF_REGS),0) 33ifeq ($(NO_PERF_REGS),0)
34 CFLAGS += -DHAVE_PERF_REGS 34 CFLAGS += -DHAVE_PERF_REGS
35endif 35endif
36 36
37ifeq ($(src-perf),) 37ifeq ($(src-perf),)
@@ -53,128 +53,128 @@ include $(src-perf)/config/feature-tests.mak
53include $(src-perf)/config/utilities.mak 53include $(src-perf)/config/utilities.mak
54 54
55ifeq ($(call get-executable,$(FLEX)),) 55ifeq ($(call get-executable,$(FLEX)),)
56 dummy := $(error Error: $(FLEX) is missing on this system, please install it) 56 dummy := $(error Error: $(FLEX) is missing on this system, please install it)
57endif 57endif
58 58
59ifeq ($(call get-executable,$(BISON)),) 59ifeq ($(call get-executable,$(BISON)),)
60 dummy := $(error Error: $(BISON) is missing on this system, please install it) 60 dummy := $(error Error: $(BISON) is missing on this system, please install it)
61endif 61endif
62 62
63# Treat warnings as errors unless directed not to 63# Treat warnings as errors unless directed not to
64ifneq ($(WERROR),0) 64ifneq ($(WERROR),0)
65 CFLAGS += -Werror 65 CFLAGS += -Werror
66endif 66endif
67 67
68ifeq ("$(origin DEBUG)", "command line") 68ifeq ("$(origin DEBUG)", "command line")
69 PERF_DEBUG = $(DEBUG) 69 PERF_DEBUG = $(DEBUG)
70endif 70endif
71ifndef PERF_DEBUG 71ifndef PERF_DEBUG
72 CFLAGS += -O6 72 CFLAGS += -O6
73endif 73endif
74 74
75ifdef PARSER_DEBUG 75ifdef PARSER_DEBUG
76 PARSER_DEBUG_BISON := -t 76 PARSER_DEBUG_BISON := -t
77 PARSER_DEBUG_FLEX := -d 77 PARSER_DEBUG_FLEX := -d
78 CFLAGS += -DPARSER_DEBUG 78 CFLAGS += -DPARSER_DEBUG
79endif 79endif
80 80
81CFLAGS += \ 81CFLAGS += \
82 -fno-omit-frame-pointer \ 82 -fno-omit-frame-pointer \
83 -ggdb3 \ 83 -ggdb3 \
84 -funwind-tables \ 84 -funwind-tables \
85 -Wall \ 85 -Wall \
86 -Wextra \ 86 -Wextra \
87 -std=gnu99 87 -std=gnu99
88 88
89EXTLIBS = -lpthread -lrt -lelf -lm 89EXTLIBS = -lpthread -lrt -lelf -lm
90 90
91ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) 91ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
92 CFLAGS += -fstack-protector-all 92 CFLAGS += -fstack-protector-all
93endif 93endif
94 94
95ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y) 95ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
96 CFLAGS += -Wstack-protector 96 CFLAGS += -Wstack-protector
97endif 97endif
98 98
99ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y) 99ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y)
100 CFLAGS += -Wvolatile-register-var 100 CFLAGS += -Wvolatile-register-var
101endif 101endif
102 102
103ifndef PERF_DEBUG 103ifndef PERF_DEBUG
104 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y) 104 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
105 CFLAGS += -D_FORTIFY_SOURCE=2 105 CFLAGS += -D_FORTIFY_SOURCE=2
106 endif 106 endif
107endif 107endif
108 108
109CFLAGS += \ 109CFLAGS += \
110 -I$(src-perf)/util/include \ 110 -I$(src-perf)/util/include \
111 -I$(src-perf)/arch/$(ARCH)/include \ 111 -I$(src-perf)/arch/$(ARCH)/include \
112 -I$(srctree)/arch/$(ARCH)/include/uapi \ 112 -I$(srctree)/arch/$(ARCH)/include/uapi \
113 -I$(srctree)/arch/$(ARCH)/include \ 113 -I$(srctree)/arch/$(ARCH)/include \
114 -I$(srctree)/include/uapi \ 114 -I$(srctree)/include/uapi \
115 -I$(srctree)/include 115 -I$(srctree)/include
116 116
117# $(obj-perf) for generated common-cmds.h 117# $(obj-perf) for generated common-cmds.h
118# $(obj-perf)/util for generated bison/flex headers 118# $(obj-perf)/util for generated bison/flex headers
119ifneq ($(OUTPUT),) 119ifneq ($(OUTPUT),)
120CFLAGS += \ 120CFLAGS += \
121 -I$(obj-perf)/util \ 121 -I$(obj-perf)/util \
122 -I$(obj-perf) 122 -I$(obj-perf)
123endif 123endif
124 124
125CFLAGS += \ 125CFLAGS += \
126 -I$(src-perf)/util \ 126 -I$(src-perf)/util \
127 -I$(src-perf) \ 127 -I$(src-perf) \
128 -I$(TRACE_EVENT_DIR) \ 128 -I$(TRACE_EVENT_DIR) \
129 -I$(srctree)/tools/lib/ 129 -I$(srctree)/tools/lib/
130 130
131CFLAGS += \ 131CFLAGS += \
132 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 132 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
133 133
134ifndef NO_BIONIC 134ifndef NO_BIONIC
135ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) 135ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
136 BIONIC := 1 136 BIONIC := 1
137 EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) 137 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
138 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) 138 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
139endif 139endif
140endif # NO_BIONIC 140endif # NO_BIONIC
141 141
142ifdef NO_LIBELF 142ifdef NO_LIBELF
143 NO_DWARF := 1 143 NO_DWARF := 1
144 NO_DEMANGLE := 1 144 NO_DEMANGLE := 1
145 NO_LIBUNWIND := 1 145 NO_LIBUNWIND := 1
146else 146else
147FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) 147FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
148ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) 148ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
149 FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS) 149 FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
150 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) 150 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
151 LIBC_SUPPORT := 1 151 LIBC_SUPPORT := 1
152 endif 152 endif
153 ifeq ($(BIONIC),1) 153 ifeq ($(BIONIC),1)
154 LIBC_SUPPORT := 1 154 LIBC_SUPPORT := 1
155 endif 155 endif
156 ifeq ($(LIBC_SUPPORT),1) 156 ifeq ($(LIBC_SUPPORT),1)
157 msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev); 157 msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
158 158
159 NO_LIBELF := 1 159 NO_LIBELF := 1
160 NO_DWARF := 1 160 NO_DWARF := 1
161 NO_DEMANGLE := 1 161 NO_DEMANGLE := 1
162 else 162 else
163 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); 163 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
164 endif 164 endif
165else 165else
166 # for linking with debug library, run like: 166 # for linking with debug library, run like:
167 # make DEBUG=1 LIBDW_DIR=/opt/libdw/ 167 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
168 ifdef LIBDW_DIR 168 ifdef LIBDW_DIR
169 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include 169 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
170 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib 170 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
171 endif 171 endif
172 172
173 FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS) 173 FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS)
174 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) 174 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
175 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev); 175 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
176 NO_DWARF := 1 176 NO_DWARF := 1
177 endif # Dwarf support 177 endif # Dwarf support
178endif # SOURCE_LIBELF 178endif # SOURCE_LIBELF
179endif # NO_LIBELF 179endif # NO_LIBELF
180 180
@@ -182,7 +182,7 @@ ifndef NO_LIBELF
182CFLAGS += -DLIBELF_SUPPORT 182CFLAGS += -DLIBELF_SUPPORT
183FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) 183FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
184ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) 184ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
185 CFLAGS += -DLIBELF_MMAP 185 CFLAGS += -DLIBELF_MMAP
186endif 186endif
187 187
188# include ARCH specific config 188# include ARCH specific config
@@ -190,12 +190,12 @@ endif
190 190
191ifndef NO_DWARF 191ifndef NO_DWARF
192ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) 192ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
193 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); 193 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
194 NO_DWARF := 1 194 NO_DWARF := 1
195else 195else
196 CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS) 196 CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS)
197 LDFLAGS += $(LIBDW_LDFLAGS) 197 LDFLAGS += $(LIBDW_LDFLAGS)
198 EXTLIBS += -lelf -ldw 198 EXTLIBS += -lelf -ldw
199endif # PERF_HAVE_DWARF_REGS 199endif # PERF_HAVE_DWARF_REGS
200endif # NO_DWARF 200endif # NO_DWARF
201 201
@@ -205,99 +205,99 @@ ifndef NO_LIBELF
205CFLAGS += -DLIBELF_SUPPORT 205CFLAGS += -DLIBELF_SUPPORT
206FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) 206FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
207ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) 207ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
208 CFLAGS += -DLIBELF_MMAP 208 CFLAGS += -DLIBELF_MMAP
209endif # try-cc 209endif # try-cc
210endif # NO_LIBELF 210endif # NO_LIBELF
211 211
212# There's only x86 (both 32 and 64) support for CFI unwind so far 212# There's only x86 (both 32 and 64) support for CFI unwind so far
213ifneq ($(ARCH),x86) 213ifneq ($(ARCH),x86)
214 NO_LIBUNWIND := 1 214 NO_LIBUNWIND := 1
215endif 215endif
216 216
217ifndef NO_LIBUNWIND 217ifndef NO_LIBUNWIND
218# for linking with debug library, run like: 218# for linking with debug library, run like:
219# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/ 219# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
220ifdef LIBUNWIND_DIR 220ifdef LIBUNWIND_DIR
221 LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include 221 LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
222 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib 222 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
223endif 223endif
224 224
225FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) 225FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
226ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) 226ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
227 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); 227 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
228 NO_LIBUNWIND := 1 228 NO_LIBUNWIND := 1
229endif # Libunwind support 229endif # Libunwind support
230endif # NO_LIBUNWIND 230endif # NO_LIBUNWIND
231 231
232ifndef NO_LIBUNWIND 232ifndef NO_LIBUNWIND
233 CFLAGS += -DLIBUNWIND_SUPPORT 233 CFLAGS += -DLIBUNWIND_SUPPORT
234 EXTLIBS += $(LIBUNWIND_LIBS) 234 EXTLIBS += $(LIBUNWIND_LIBS)
235 CFLAGS += $(LIBUNWIND_CFLAGS) 235 CFLAGS += $(LIBUNWIND_CFLAGS)
236 LDFLAGS += $(LIBUNWIND_LDFLAGS) 236 LDFLAGS += $(LIBUNWIND_LDFLAGS)
237endif # NO_LIBUNWIND 237endif # NO_LIBUNWIND
238 238
239ifndef NO_LIBAUDIT 239ifndef NO_LIBAUDIT
240 FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit 240 FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit
241 ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) 241 ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
242 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); 242 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
243 NO_LIBAUDIT := 1 243 NO_LIBAUDIT := 1
244 else 244 else
245 CFLAGS += -DLIBAUDIT_SUPPORT 245 CFLAGS += -DLIBAUDIT_SUPPORT
246 EXTLIBS += -laudit 246 EXTLIBS += -laudit
247 endif 247 endif
248endif 248endif
249 249
250ifdef NO_NEWT 250ifdef NO_NEWT
251 NO_SLANG=1 251 NO_SLANG=1
252endif 252endif
253 253
254ifndef NO_SLANG 254ifndef NO_SLANG
255 FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang 255 FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
256 ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) 256 ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
257 msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); 257 msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
258 NO_SLANG := 1 258 NO_SLANG := 1
259 else 259 else
260 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h 260 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
261 CFLAGS += -I/usr/include/slang 261 CFLAGS += -I/usr/include/slang
262 CFLAGS += -DSLANG_SUPPORT 262 CFLAGS += -DSLANG_SUPPORT
263 EXTLIBS += -lslang 263 EXTLIBS += -lslang
264 endif 264 endif
265endif 265endif
266 266
267ifndef NO_GTK2 267ifndef NO_GTK2
268 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) 268 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
269 ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) 269 ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
270 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); 270 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
271 NO_GTK2 := 1 271 NO_GTK2 := 1
272 else 272 else
273 ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) 273 ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
274 CFLAGS += -DHAVE_GTK_INFO_BAR 274 CFLAGS += -DHAVE_GTK_INFO_BAR
275 endif 275 endif
276 CFLAGS += -DGTK2_SUPPORT 276 CFLAGS += -DGTK2_SUPPORT
277 CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) 277 CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
278 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) 278 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
279 endif 279 endif
280endif 280endif
281 281
282grep-libs = $(filter -l%,$(1)) 282grep-libs = $(filter -l%,$(1))
283strip-libs = $(filter-out -l%,$(1)) 283strip-libs = $(filter-out -l%,$(1))
284 284
285ifdef NO_LIBPERL 285ifdef NO_LIBPERL
286 CFLAGS += -DNO_LIBPERL 286 CFLAGS += -DNO_LIBPERL
287else 287else
288 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) 288 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
289 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) 289 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
290 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) 290 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
291 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` 291 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
292 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) 292 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
293 293
294 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y) 294 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
295 CFLAGS += -DNO_LIBPERL 295 CFLAGS += -DNO_LIBPERL
296 NO_LIBPERL := 1 296 NO_LIBPERL := 1
297 else 297 else
298 LDFLAGS += $(PERL_EMBED_LDFLAGS) 298 LDFLAGS += $(PERL_EMBED_LDFLAGS)
299 EXTLIBS += $(PERL_EMBED_LIBADD) 299 EXTLIBS += $(PERL_EMBED_LIBADD)
300 endif 300 endif
301endif 301endif
302 302
303disable-python = $(eval $(disable-python_code)) 303disable-python = $(eval $(disable-python_code))
@@ -364,69 +364,69 @@ else
364endif 364endif
365 365
366ifdef NO_DEMANGLE 366ifdef NO_DEMANGLE
367 CFLAGS += -DNO_DEMANGLE 367 CFLAGS += -DNO_DEMANGLE
368else 368else
369 ifdef HAVE_CPLUS_DEMANGLE 369 ifdef HAVE_CPLUS_DEMANGLE
370 EXTLIBS += -liberty 370 EXTLIBS += -liberty
371 CFLAGS += -DHAVE_CPLUS_DEMANGLE 371 CFLAGS += -DHAVE_CPLUS_DEMANGLE
372 else 372 else
373 FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd 373 FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
374 has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) 374 has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
375 ifeq ($(has_bfd),y) 375 ifeq ($(has_bfd),y)
376 EXTLIBS += -lbfd 376 EXTLIBS += -lbfd
377 else 377 else
378 FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty 378 FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
379 has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) 379 has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
380 ifeq ($(has_bfd_iberty),y) 380 ifeq ($(has_bfd_iberty),y)
381 EXTLIBS += -lbfd -liberty 381 EXTLIBS += -lbfd -liberty
382 else 382 else
383 FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz 383 FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
384 has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz) 384 has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
385 ifeq ($(has_bfd_iberty_z),y) 385 ifeq ($(has_bfd_iberty_z),y)
386 EXTLIBS += -lbfd -liberty -lz 386 EXTLIBS += -lbfd -liberty -lz
387 else 387 else
388 FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty 388 FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty
389 has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) 389 has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
390 ifeq ($(has_cplus_demangle),y) 390 ifeq ($(has_cplus_demangle),y)
391 EXTLIBS += -liberty 391 EXTLIBS += -liberty
392 CFLAGS += -DHAVE_CPLUS_DEMANGLE 392 CFLAGS += -DHAVE_CPLUS_DEMANGLE
393 else 393 else
394 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling) 394 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
395 CFLAGS += -DNO_DEMANGLE 395 CFLAGS += -DNO_DEMANGLE
396 endif 396 endif
397 endif 397 endif
398 endif 398 endif
399 endif 399 endif
400 endif 400 endif
401endif 401endif
402 402
403ifndef NO_STRLCPY 403ifndef NO_STRLCPY
404 ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) 404 ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
405 CFLAGS += -DHAVE_STRLCPY 405 CFLAGS += -DHAVE_STRLCPY
406 endif 406 endif
407endif 407endif
408 408
409ifndef NO_ON_EXIT 409ifndef NO_ON_EXIT
410 ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y) 410 ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
411 CFLAGS += -DHAVE_ON_EXIT 411 CFLAGS += -DHAVE_ON_EXIT
412 endif 412 endif
413endif 413endif
414 414
415ifndef NO_BACKTRACE 415ifndef NO_BACKTRACE
416 ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y) 416 ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
417 CFLAGS += -DBACKTRACE_SUPPORT 417 CFLAGS += -DBACKTRACE_SUPPORT
418 endif 418 endif
419endif 419endif
420 420
421ifndef NO_LIBNUMA 421ifndef NO_LIBNUMA
422 FLAGS_LIBNUMA = $(CFLAGS) $(LDFLAGS) -lnuma 422 FLAGS_LIBNUMA = $(CFLAGS) $(LDFLAGS) -lnuma
423 ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y) 423 ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
424 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev); 424 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev);
425 NO_LIBNUMA := 1 425 NO_LIBNUMA := 1
426 else 426 else
427 CFLAGS += -DLIBNUMA_SUPPORT 427 CFLAGS += -DLIBNUMA_SUPPORT
428 EXTLIBS += -lnuma 428 EXTLIBS += -lnuma
429 endif 429 endif
430endif 430endif
431 431
432# Among the variables below, these: 432# Among the variables below, these: