diff options
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 173 |
1 files changed, 139 insertions, 34 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 35655c3a7b7a..e5e71e7d95a0 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -37,7 +37,14 @@ include config/utilities.mak | |||
37 | # | 37 | # |
38 | # Define NO_NEWT if you do not want TUI support. | 38 | # Define NO_NEWT if you do not want TUI support. |
39 | # | 39 | # |
40 | # Define NO_GTK2 if you do not want GTK+ GUI support. | ||
41 | # | ||
40 | # Define NO_DEMANGLE if you do not want C++ symbol demangling. | 42 | # Define NO_DEMANGLE if you do not want C++ symbol demangling. |
43 | # | ||
44 | # Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds) | ||
45 | # | ||
46 | # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf | ||
47 | # backtrace post unwind. | ||
41 | 48 | ||
42 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE | 49 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE |
43 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 50 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
@@ -50,16 +57,19 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | |||
50 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | 57 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ |
51 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | 58 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ |
52 | -e s/sh[234].*/sh/ ) | 59 | -e s/sh[234].*/sh/ ) |
60 | NO_PERF_REGS := 1 | ||
53 | 61 | ||
54 | CC = $(CROSS_COMPILE)gcc | 62 | CC = $(CROSS_COMPILE)gcc |
55 | AR = $(CROSS_COMPILE)ar | 63 | AR = $(CROSS_COMPILE)ar |
56 | 64 | ||
57 | # Additional ARCH settings for x86 | 65 | # Additional ARCH settings for x86 |
58 | ifeq ($(ARCH),i386) | 66 | ifeq ($(ARCH),i386) |
59 | ARCH := x86 | 67 | override ARCH := x86 |
68 | NO_PERF_REGS := 0 | ||
69 | LIBUNWIND_LIBS = -lunwind -lunwind-x86 | ||
60 | endif | 70 | endif |
61 | ifeq ($(ARCH),x86_64) | 71 | ifeq ($(ARCH),x86_64) |
62 | ARCH := x86 | 72 | override ARCH := x86 |
63 | IS_X86_64 := 0 | 73 | IS_X86_64 := 0 |
64 | ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) | 74 | ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) |
65 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) | 75 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) |
@@ -69,6 +79,8 @@ ifeq ($(ARCH),x86_64) | |||
69 | ARCH_CFLAGS := -DARCH_X86_64 | 79 | ARCH_CFLAGS := -DARCH_X86_64 |
70 | ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S | 80 | ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S |
71 | endif | 81 | endif |
82 | NO_PERF_REGS := 0 | ||
83 | LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 | ||
72 | endif | 84 | endif |
73 | 85 | ||
74 | # Treat warnings as errors unless directed not to | 86 | # Treat warnings as errors unless directed not to |
@@ -89,7 +101,7 @@ ifdef PARSER_DEBUG | |||
89 | PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG | 101 | PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG |
90 | endif | 102 | endif |
91 | 103 | ||
92 | CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) | 104 | CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) |
93 | EXTLIBS = -lpthread -lrt -lelf -lm | 105 | EXTLIBS = -lpthread -lrt -lelf -lm |
94 | ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 106 | ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
95 | ALL_LDFLAGS = $(LDFLAGS) | 107 | ALL_LDFLAGS = $(LDFLAGS) |
@@ -186,10 +198,10 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) | |||
186 | 198 | ||
187 | TRACE_EVENT_DIR = ../lib/traceevent/ | 199 | TRACE_EVENT_DIR = ../lib/traceevent/ |
188 | 200 | ||
189 | ifeq ("$(origin O)", "command line") | 201 | ifneq ($(OUTPUT),) |
190 | TE_PATH=$(OUTPUT)/ | 202 | TE_PATH=$(OUTPUT) |
191 | else | 203 | else |
192 | TE_PATH=$(TRACE_EVENT_DIR)/ | 204 | TE_PATH=$(TRACE_EVENT_DIR) |
193 | endif | 205 | endif |
194 | 206 | ||
195 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a | 207 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a |
@@ -221,13 +233,13 @@ export PERL_PATH | |||
221 | FLEX = flex | 233 | FLEX = flex |
222 | BISON= bison | 234 | BISON= bison |
223 | 235 | ||
224 | $(OUTPUT)util/parse-events-flex.c: util/parse-events.l | 236 | $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c |
225 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c | 237 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c |
226 | 238 | ||
227 | $(OUTPUT)util/parse-events-bison.c: util/parse-events.y | 239 | $(OUTPUT)util/parse-events-bison.c: util/parse-events.y |
228 | $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c | 240 | $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c |
229 | 241 | ||
230 | $(OUTPUT)util/pmu-flex.c: util/pmu.l | 242 | $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c |
231 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c | 243 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c |
232 | 244 | ||
233 | $(OUTPUT)util/pmu-bison.c: util/pmu.y | 245 | $(OUTPUT)util/pmu-bison.c: util/pmu.y |
@@ -252,6 +264,7 @@ LIB_H += util/include/linux/ctype.h | |||
252 | LIB_H += util/include/linux/kernel.h | 264 | LIB_H += util/include/linux/kernel.h |
253 | LIB_H += util/include/linux/list.h | 265 | LIB_H += util/include/linux/list.h |
254 | LIB_H += util/include/linux/export.h | 266 | LIB_H += util/include/linux/export.h |
267 | LIB_H += util/include/linux/magic.h | ||
255 | LIB_H += util/include/linux/poison.h | 268 | LIB_H += util/include/linux/poison.h |
256 | LIB_H += util/include/linux/prefetch.h | 269 | LIB_H += util/include/linux/prefetch.h |
257 | LIB_H += util/include/linux/rbtree.h | 270 | LIB_H += util/include/linux/rbtree.h |
@@ -321,6 +334,10 @@ LIB_H += $(TRACE_EVENT_DIR)event-parse.h | |||
321 | LIB_H += util/target.h | 334 | LIB_H += util/target.h |
322 | LIB_H += util/rblist.h | 335 | LIB_H += util/rblist.h |
323 | LIB_H += util/intlist.h | 336 | LIB_H += util/intlist.h |
337 | LIB_H += util/perf_regs.h | ||
338 | LIB_H += util/unwind.h | ||
339 | LIB_H += ui/helpline.h | ||
340 | LIB_H += util/vdso.h | ||
324 | 341 | ||
325 | LIB_OBJS += $(OUTPUT)util/abspath.o | 342 | LIB_OBJS += $(OUTPUT)util/abspath.o |
326 | LIB_OBJS += $(OUTPUT)util/alias.o | 343 | LIB_OBJS += $(OUTPUT)util/alias.o |
@@ -356,6 +373,7 @@ LIB_OBJS += $(OUTPUT)util/usage.o | |||
356 | LIB_OBJS += $(OUTPUT)util/wrapper.o | 373 | LIB_OBJS += $(OUTPUT)util/wrapper.o |
357 | LIB_OBJS += $(OUTPUT)util/sigchain.o | 374 | LIB_OBJS += $(OUTPUT)util/sigchain.o |
358 | LIB_OBJS += $(OUTPUT)util/symbol.o | 375 | LIB_OBJS += $(OUTPUT)util/symbol.o |
376 | LIB_OBJS += $(OUTPUT)util/symbol-elf.o | ||
359 | LIB_OBJS += $(OUTPUT)util/dso-test-data.o | 377 | LIB_OBJS += $(OUTPUT)util/dso-test-data.o |
360 | LIB_OBJS += $(OUTPUT)util/color.o | 378 | LIB_OBJS += $(OUTPUT)util/color.o |
361 | LIB_OBJS += $(OUTPUT)util/pager.o | 379 | LIB_OBJS += $(OUTPUT)util/pager.o |
@@ -387,11 +405,15 @@ LIB_OBJS += $(OUTPUT)util/cgroup.o | |||
387 | LIB_OBJS += $(OUTPUT)util/target.o | 405 | LIB_OBJS += $(OUTPUT)util/target.o |
388 | LIB_OBJS += $(OUTPUT)util/rblist.o | 406 | LIB_OBJS += $(OUTPUT)util/rblist.o |
389 | LIB_OBJS += $(OUTPUT)util/intlist.o | 407 | LIB_OBJS += $(OUTPUT)util/intlist.o |
408 | LIB_OBJS += $(OUTPUT)util/vdso.o | ||
409 | LIB_OBJS += $(OUTPUT)util/stat.o | ||
390 | 410 | ||
391 | BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o | 411 | LIB_OBJS += $(OUTPUT)ui/helpline.o |
412 | LIB_OBJS += $(OUTPUT)ui/hist.o | ||
413 | LIB_OBJS += $(OUTPUT)ui/stdio/hist.o | ||
392 | 414 | ||
415 | BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o | ||
393 | BUILTIN_OBJS += $(OUTPUT)builtin-bench.o | 416 | BUILTIN_OBJS += $(OUTPUT)builtin-bench.o |
394 | |||
395 | # Benchmark modules | 417 | # Benchmark modules |
396 | BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o | 418 | BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o |
397 | BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o | 419 | BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o |
@@ -449,34 +471,73 @@ PYRF_OBJS += $(OUTPUT)util/xyarray.o | |||
449 | -include config.mak.autogen | 471 | -include config.mak.autogen |
450 | -include config.mak | 472 | -include config.mak |
451 | 473 | ||
452 | ifndef NO_DWARF | 474 | ifdef NO_LIBELF |
453 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | ||
454 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) | ||
455 | 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); | ||
456 | NO_DWARF := 1 | 475 | NO_DWARF := 1 |
457 | endif # Dwarf support | 476 | NO_DEMANGLE := 1 |
458 | endif # NO_DWARF | 477 | NO_LIBUNWIND := 1 |
459 | 478 | else | |
460 | -include arch/$(ARCH)/Makefile | ||
461 | |||
462 | ifneq ($(OUTPUT),) | ||
463 | BASIC_CFLAGS += -I$(OUTPUT) | ||
464 | endif | ||
465 | |||
466 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 479 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) |
467 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) | 480 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) |
468 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) | 481 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) |
469 | ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) | 482 | ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) |
470 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | 483 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); |
471 | else | 484 | else |
472 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); | 485 | NO_LIBELF := 1 |
486 | NO_DWARF := 1 | ||
487 | NO_DEMANGLE := 1 | ||
473 | endif | 488 | endif |
474 | endif | 489 | endif |
490 | endif # NO_LIBELF | ||
491 | |||
492 | ifndef NO_LIBUNWIND | ||
493 | # for linking with debug library, run like: | ||
494 | # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/ | ||
495 | ifdef LIBUNWIND_DIR | ||
496 | LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include | ||
497 | LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib | ||
498 | endif | ||
499 | |||
500 | FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) | ||
501 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND)),y) | ||
502 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); | ||
503 | NO_LIBUNWIND := 1 | ||
504 | endif # Libunwind support | ||
505 | endif # NO_LIBUNWIND | ||
506 | |||
507 | -include arch/$(ARCH)/Makefile | ||
508 | |||
509 | ifneq ($(OUTPUT),) | ||
510 | BASIC_CFLAGS += -I$(OUTPUT) | ||
511 | endif | ||
512 | |||
513 | ifdef NO_LIBELF | ||
514 | BASIC_CFLAGS += -DNO_LIBELF_SUPPORT | ||
515 | |||
516 | EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) | ||
517 | |||
518 | # Remove ELF/DWARF dependent codes | ||
519 | LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS)) | ||
520 | LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS)) | ||
521 | LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS)) | ||
522 | LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS)) | ||
523 | |||
524 | BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS)) | ||
525 | |||
526 | # Use minimal symbol handling | ||
527 | LIB_OBJS += $(OUTPUT)util/symbol-minimal.o | ||
528 | |||
529 | else # NO_LIBELF | ||
475 | 530 | ||
476 | ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) | 531 | ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) |
477 | BASIC_CFLAGS += -DLIBELF_NO_MMAP | 532 | BASIC_CFLAGS += -DLIBELF_NO_MMAP |
478 | endif | 533 | endif |
479 | 534 | ||
535 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | ||
536 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) | ||
537 | 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); | ||
538 | NO_DWARF := 1 | ||
539 | endif # Dwarf support | ||
540 | |||
480 | ifndef NO_DWARF | 541 | ifndef NO_DWARF |
481 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 542 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
482 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 543 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); |
@@ -487,6 +548,29 @@ else | |||
487 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o | 548 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o |
488 | endif # PERF_HAVE_DWARF_REGS | 549 | endif # PERF_HAVE_DWARF_REGS |
489 | endif # NO_DWARF | 550 | endif # NO_DWARF |
551 | endif # NO_LIBELF | ||
552 | |||
553 | ifdef NO_LIBUNWIND | ||
554 | BASIC_CFLAGS += -DNO_LIBUNWIND_SUPPORT | ||
555 | else | ||
556 | EXTLIBS += $(LIBUNWIND_LIBS) | ||
557 | BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS) | ||
558 | BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS) | ||
559 | LIB_OBJS += $(OUTPUT)util/unwind.o | ||
560 | endif | ||
561 | |||
562 | ifdef NO_LIBAUDIT | ||
563 | BASIC_CFLAGS += -DNO_LIBAUDIT_SUPPORT | ||
564 | else | ||
565 | FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit | ||
566 | ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT)),y) | ||
567 | msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); | ||
568 | BASIC_CFLAGS += -DNO_LIBAUDIT_SUPPORT | ||
569 | else | ||
570 | BUILTIN_OBJS += $(OUTPUT)builtin-trace.o | ||
571 | EXTLIBS += -laudit | ||
572 | endif | ||
573 | endif | ||
490 | 574 | ||
491 | ifdef NO_NEWT | 575 | ifdef NO_NEWT |
492 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT | 576 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT |
@@ -504,14 +588,13 @@ else | |||
504 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o | 588 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o |
505 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o | 589 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o |
506 | LIB_OBJS += $(OUTPUT)ui/browsers/map.o | 590 | LIB_OBJS += $(OUTPUT)ui/browsers/map.o |
507 | LIB_OBJS += $(OUTPUT)ui/helpline.o | ||
508 | LIB_OBJS += $(OUTPUT)ui/progress.o | 591 | LIB_OBJS += $(OUTPUT)ui/progress.o |
509 | LIB_OBJS += $(OUTPUT)ui/util.o | 592 | LIB_OBJS += $(OUTPUT)ui/util.o |
510 | LIB_OBJS += $(OUTPUT)ui/tui/setup.o | 593 | LIB_OBJS += $(OUTPUT)ui/tui/setup.o |
511 | LIB_OBJS += $(OUTPUT)ui/tui/util.o | 594 | LIB_OBJS += $(OUTPUT)ui/tui/util.o |
595 | LIB_OBJS += $(OUTPUT)ui/tui/helpline.o | ||
512 | LIB_H += ui/browser.h | 596 | LIB_H += ui/browser.h |
513 | LIB_H += ui/browsers/map.h | 597 | LIB_H += ui/browsers/map.h |
514 | LIB_H += ui/helpline.h | ||
515 | LIB_H += ui/keysyms.h | 598 | LIB_H += ui/keysyms.h |
516 | LIB_H += ui/libslang.h | 599 | LIB_H += ui/libslang.h |
517 | LIB_H += ui/progress.h | 600 | LIB_H += ui/progress.h |
@@ -523,7 +606,7 @@ endif | |||
523 | ifdef NO_GTK2 | 606 | ifdef NO_GTK2 |
524 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT | 607 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT |
525 | else | 608 | else |
526 | FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0) | 609 | FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
527 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y) | 610 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y) |
528 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); | 611 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); |
529 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT | 612 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT |
@@ -531,11 +614,12 @@ else | |||
531 | ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y) | 614 | ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y) |
532 | BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR | 615 | BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR |
533 | endif | 616 | endif |
534 | BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0) | 617 | BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) |
535 | EXTLIBS += $(shell pkg-config --libs gtk+-2.0) | 618 | EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) |
536 | LIB_OBJS += $(OUTPUT)ui/gtk/browser.o | 619 | LIB_OBJS += $(OUTPUT)ui/gtk/browser.o |
537 | LIB_OBJS += $(OUTPUT)ui/gtk/setup.o | 620 | LIB_OBJS += $(OUTPUT)ui/gtk/setup.o |
538 | LIB_OBJS += $(OUTPUT)ui/gtk/util.o | 621 | LIB_OBJS += $(OUTPUT)ui/gtk/util.o |
622 | LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o | ||
539 | # Make sure that it'd be included only once. | 623 | # Make sure that it'd be included only once. |
540 | ifneq ($(findstring -DNO_NEWT_SUPPORT,$(BASIC_CFLAGS)),) | 624 | ifneq ($(findstring -DNO_NEWT_SUPPORT,$(BASIC_CFLAGS)),) |
541 | LIB_OBJS += $(OUTPUT)ui/setup.o | 625 | LIB_OBJS += $(OUTPUT)ui/setup.o |
@@ -644,7 +728,7 @@ else | |||
644 | EXTLIBS += -liberty | 728 | EXTLIBS += -liberty |
645 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE | 729 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE |
646 | else | 730 | else |
647 | FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd | 731 | FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd |
648 | has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD)) | 732 | has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD)) |
649 | ifeq ($(has_bfd),y) | 733 | ifeq ($(has_bfd),y) |
650 | EXTLIBS += -lbfd | 734 | EXTLIBS += -lbfd |
@@ -674,6 +758,13 @@ else | |||
674 | endif | 758 | endif |
675 | endif | 759 | endif |
676 | 760 | ||
761 | ifeq ($(NO_PERF_REGS),0) | ||
762 | ifeq ($(ARCH),x86) | ||
763 | LIB_H += arch/x86/include/perf_regs.h | ||
764 | endif | ||
765 | else | ||
766 | BASIC_CFLAGS += -DNO_PERF_REGS | ||
767 | endif | ||
677 | 768 | ||
678 | ifdef NO_STRLCPY | 769 | ifdef NO_STRLCPY |
679 | BASIC_CFLAGS += -DNO_STRLCPY | 770 | BASIC_CFLAGS += -DNO_STRLCPY |
@@ -683,6 +774,14 @@ else | |||
683 | endif | 774 | endif |
684 | endif | 775 | endif |
685 | 776 | ||
777 | ifdef NO_BACKTRACE | ||
778 | BASIC_CFLAGS += -DNO_BACKTRACE | ||
779 | else | ||
780 | ifneq ($(call try-cc,$(SOURCE_BACKTRACE),),y) | ||
781 | BASIC_CFLAGS += -DNO_BACKTRACE | ||
782 | endif | ||
783 | endif | ||
784 | |||
686 | ifdef ASCIIDOC8 | 785 | ifdef ASCIIDOC8 |
687 | export ASCIIDOC8 | 786 | export ASCIIDOC8 |
688 | endif | 787 | endif |
@@ -700,6 +799,7 @@ perfexecdir_SQ = $(subst ','\'',$(perfexecdir)) | |||
700 | template_dir_SQ = $(subst ','\'',$(template_dir)) | 799 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
701 | htmldir_SQ = $(subst ','\'',$(htmldir)) | 800 | htmldir_SQ = $(subst ','\'',$(htmldir)) |
702 | prefix_SQ = $(subst ','\'',$(prefix)) | 801 | prefix_SQ = $(subst ','\'',$(prefix)) |
802 | sysconfdir_SQ = $(subst ','\'',$(sysconfdir)) | ||
703 | 803 | ||
704 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) | 804 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
705 | 805 | ||
@@ -767,10 +867,10 @@ $(OUTPUT)perf.o perf.spec \ | |||
767 | # over the general rule for .o | 867 | # over the general rule for .o |
768 | 868 | ||
769 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS | 869 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS |
770 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $< | 870 | $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -w $< |
771 | 871 | ||
772 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS | 872 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS |
773 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $< | 873 | $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $< |
774 | 874 | ||
775 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS | 875 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS |
776 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 876 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
@@ -842,7 +942,10 @@ $(LIB_FILE): $(LIB_OBJS) | |||
842 | 942 | ||
843 | # libtraceevent.a | 943 | # libtraceevent.a |
844 | $(LIBTRACEEVENT): | 944 | $(LIBTRACEEVENT): |
845 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) $(COMMAND_O) libtraceevent.a | 945 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a |
946 | |||
947 | $(LIBTRACEEVENT)-clean: | ||
948 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean | ||
846 | 949 | ||
847 | help: | 950 | help: |
848 | @echo 'Perf make targets:' | 951 | @echo 'Perf make targets:' |
@@ -951,6 +1054,8 @@ install: all | |||
951 | $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace' | 1054 | $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace' |
952 | $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python' | 1055 | $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python' |
953 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' | 1056 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' |
1057 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d' | ||
1058 | $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf' | ||
954 | 1059 | ||
955 | install-python_ext: | 1060 | install-python_ext: |
956 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' | 1061 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' |
@@ -981,7 +1086,7 @@ quick-install-html: | |||
981 | 1086 | ||
982 | ### Cleaning rules | 1087 | ### Cleaning rules |
983 | 1088 | ||
984 | clean: | 1089 | clean: $(LIBTRACEEVENT)-clean |
985 | $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) | 1090 | $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) |
986 | $(RM) $(ALL_PROGRAMS) perf | 1091 | $(RM) $(ALL_PROGRAMS) perf |
987 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* | 1092 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* |