diff options
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 61 |
1 files changed, 46 insertions, 15 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index bb74c79cd16e..b0f164b133d9 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -35,7 +35,9 @@ include config/utilities.mak | |||
35 | # | 35 | # |
36 | # Define WERROR=0 to disable treating any warnings as errors. | 36 | # Define WERROR=0 to disable treating any warnings as errors. |
37 | # | 37 | # |
38 | # Define NO_NEWT if you do not want TUI support. | 38 | # Define NO_NEWT if you do not want TUI support. (deprecated) |
39 | # | ||
40 | # Define NO_SLANG if you do not want TUI support. | ||
39 | # | 41 | # |
40 | # Define NO_GTK2 if you do not want GTK+ GUI support. | 42 | # Define NO_GTK2 if you do not want GTK+ GUI support. |
41 | # | 43 | # |
@@ -104,6 +106,10 @@ ifdef PARSER_DEBUG | |||
104 | PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG | 106 | PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG |
105 | endif | 107 | endif |
106 | 108 | ||
109 | ifdef NO_NEWT | ||
110 | NO_SLANG=1 | ||
111 | endif | ||
112 | |||
107 | CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) | 113 | CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) |
108 | EXTLIBS = -lpthread -lrt -lelf -lm | 114 | EXTLIBS = -lpthread -lrt -lelf -lm |
109 | ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 115 | ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
@@ -215,6 +221,7 @@ BASIC_CFLAGS = \ | |||
215 | -Iutil \ | 221 | -Iutil \ |
216 | -I. \ | 222 | -I. \ |
217 | -I$(TRACE_EVENT_DIR) \ | 223 | -I$(TRACE_EVENT_DIR) \ |
224 | -I../lib/ \ | ||
218 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 225 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
219 | 226 | ||
220 | BASIC_LDFLAGS = | 227 | BASIC_LDFLAGS = |
@@ -240,19 +247,28 @@ SCRIPT_SH += perf-archive.sh | |||
240 | grep-libs = $(filter -l%,$(1)) | 247 | grep-libs = $(filter -l%,$(1)) |
241 | strip-libs = $(filter-out -l%,$(1)) | 248 | strip-libs = $(filter-out -l%,$(1)) |
242 | 249 | ||
250 | LK_DIR = ../lib/lk/ | ||
243 | TRACE_EVENT_DIR = ../lib/traceevent/ | 251 | TRACE_EVENT_DIR = ../lib/traceevent/ |
244 | 252 | ||
253 | LK_PATH=$(LK_DIR) | ||
254 | |||
245 | ifneq ($(OUTPUT),) | 255 | ifneq ($(OUTPUT),) |
246 | TE_PATH=$(OUTPUT) | 256 | TE_PATH=$(OUTPUT) |
257 | ifneq ($(subdir),) | ||
258 | LK_PATH=$(OUTPUT)$(LK_DIR) | ||
259 | else | ||
260 | LK_PATH=$(OUTPUT) | ||
261 | endif | ||
247 | else | 262 | else |
248 | TE_PATH=$(TRACE_EVENT_DIR) | 263 | TE_PATH=$(TRACE_EVENT_DIR) |
249 | endif | 264 | endif |
250 | 265 | ||
251 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a | 266 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a |
252 | TE_LIB := -L$(TE_PATH) -ltraceevent | ||
253 | |||
254 | export LIBTRACEEVENT | 267 | export LIBTRACEEVENT |
255 | 268 | ||
269 | LIBLK = $(LK_PATH)liblk.a | ||
270 | export LIBLK | ||
271 | |||
256 | # python extension build directories | 272 | # python extension build directories |
257 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ | 273 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ |
258 | PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ | 274 | PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ |
@@ -262,7 +278,7 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP | |||
262 | python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so | 278 | python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so |
263 | 279 | ||
264 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) | 280 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) |
265 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py | 281 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) |
266 | 282 | ||
267 | $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) | 283 | $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) |
268 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ | 284 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ |
@@ -355,7 +371,6 @@ LIB_H += util/cache.h | |||
355 | LIB_H += util/callchain.h | 371 | LIB_H += util/callchain.h |
356 | LIB_H += util/build-id.h | 372 | LIB_H += util/build-id.h |
357 | LIB_H += util/debug.h | 373 | LIB_H += util/debug.h |
358 | LIB_H += util/debugfs.h | ||
359 | LIB_H += util/sysfs.h | 374 | LIB_H += util/sysfs.h |
360 | LIB_H += util/pmu.h | 375 | LIB_H += util/pmu.h |
361 | LIB_H += util/event.h | 376 | LIB_H += util/event.h |
@@ -416,7 +431,6 @@ LIB_OBJS += $(OUTPUT)util/annotate.o | |||
416 | LIB_OBJS += $(OUTPUT)util/build-id.o | 431 | LIB_OBJS += $(OUTPUT)util/build-id.o |
417 | LIB_OBJS += $(OUTPUT)util/config.o | 432 | LIB_OBJS += $(OUTPUT)util/config.o |
418 | LIB_OBJS += $(OUTPUT)util/ctype.o | 433 | LIB_OBJS += $(OUTPUT)util/ctype.o |
419 | LIB_OBJS += $(OUTPUT)util/debugfs.o | ||
420 | LIB_OBJS += $(OUTPUT)util/sysfs.o | 434 | LIB_OBJS += $(OUTPUT)util/sysfs.o |
421 | LIB_OBJS += $(OUTPUT)util/pmu.o | 435 | LIB_OBJS += $(OUTPUT)util/pmu.o |
422 | LIB_OBJS += $(OUTPUT)util/environment.o | 436 | LIB_OBJS += $(OUTPUT)util/environment.o |
@@ -503,6 +517,10 @@ LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o | |||
503 | LIB_OBJS += $(OUTPUT)tests/pmu.o | 517 | LIB_OBJS += $(OUTPUT)tests/pmu.o |
504 | LIB_OBJS += $(OUTPUT)tests/hists_link.o | 518 | LIB_OBJS += $(OUTPUT)tests/hists_link.o |
505 | LIB_OBJS += $(OUTPUT)tests/python-use.o | 519 | LIB_OBJS += $(OUTPUT)tests/python-use.o |
520 | LIB_OBJS += $(OUTPUT)tests/bp_signal.o | ||
521 | LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o | ||
522 | LIB_OBJS += $(OUTPUT)tests/task-exit.o | ||
523 | LIB_OBJS += $(OUTPUT)tests/sw-clock.o | ||
506 | 524 | ||
507 | BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o | 525 | BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o |
508 | BUILTIN_OBJS += $(OUTPUT)builtin-bench.o | 526 | BUILTIN_OBJS += $(OUTPUT)builtin-bench.o |
@@ -535,8 +553,9 @@ BUILTIN_OBJS += $(OUTPUT)builtin-lock.o | |||
535 | BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o | 553 | BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o |
536 | BUILTIN_OBJS += $(OUTPUT)builtin-inject.o | 554 | BUILTIN_OBJS += $(OUTPUT)builtin-inject.o |
537 | BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o | 555 | BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o |
556 | BUILTIN_OBJS += $(OUTPUT)builtin-mem.o | ||
538 | 557 | ||
539 | PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT) | 558 | PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT) |
540 | 559 | ||
541 | # | 560 | # |
542 | # Platform specific tweaks | 561 | # Platform specific tweaks |
@@ -667,15 +686,15 @@ ifndef NO_LIBAUDIT | |||
667 | endif | 686 | endif |
668 | endif | 687 | endif |
669 | 688 | ||
670 | ifndef NO_NEWT | 689 | ifndef NO_SLANG |
671 | FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt | 690 | FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang |
672 | ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y) | 691 | ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) |
673 | msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); | 692 | msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); |
674 | else | 693 | else |
675 | # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h | 694 | # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h |
676 | BASIC_CFLAGS += -I/usr/include/slang | 695 | BASIC_CFLAGS += -I/usr/include/slang |
677 | BASIC_CFLAGS += -DNEWT_SUPPORT | 696 | BASIC_CFLAGS += -DSLANG_SUPPORT |
678 | EXTLIBS += -lnewt -lslang | 697 | EXTLIBS += -lslang |
679 | LIB_OBJS += $(OUTPUT)ui/browser.o | 698 | LIB_OBJS += $(OUTPUT)ui/browser.o |
680 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o | 699 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o |
681 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o | 700 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o |
@@ -1051,6 +1070,18 @@ $(LIBTRACEEVENT): | |||
1051 | $(LIBTRACEEVENT)-clean: | 1070 | $(LIBTRACEEVENT)-clean: |
1052 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean | 1071 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean |
1053 | 1072 | ||
1073 | # if subdir is set, we've been called from above so target has been built | ||
1074 | # already | ||
1075 | $(LIBLK): | ||
1076 | ifeq ($(subdir),) | ||
1077 | $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a | ||
1078 | endif | ||
1079 | |||
1080 | $(LIBLK)-clean: | ||
1081 | ifeq ($(subdir),) | ||
1082 | $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean | ||
1083 | endif | ||
1084 | |||
1054 | help: | 1085 | help: |
1055 | @echo 'Perf make targets:' | 1086 | @echo 'Perf make targets:' |
1056 | @echo ' doc - make *all* documentation (see below)' | 1087 | @echo ' doc - make *all* documentation (see below)' |
@@ -1171,7 +1202,7 @@ $(INSTALL_DOC_TARGETS): | |||
1171 | 1202 | ||
1172 | ### Cleaning rules | 1203 | ### Cleaning rules |
1173 | 1204 | ||
1174 | clean: $(LIBTRACEEVENT)-clean | 1205 | clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean |
1175 | $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) | 1206 | $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) |
1176 | $(RM) $(ALL_PROGRAMS) perf | 1207 | $(RM) $(ALL_PROGRAMS) perf |
1177 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* | 1208 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* |
@@ -1181,6 +1212,6 @@ clean: $(LIBTRACEEVENT)-clean | |||
1181 | $(RM) $(OUTPUT)util/*-flex* | 1212 | $(RM) $(OUTPUT)util/*-flex* |
1182 | $(python-clean) | 1213 | $(python-clean) |
1183 | 1214 | ||
1184 | .PHONY: all install clean strip $(LIBTRACEEVENT) | 1215 | .PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK) |
1185 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell | 1216 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
1186 | .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS | 1217 | .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS |