diff options
Diffstat (limited to 'tools/perf/Makefile')
| -rw-r--r-- | tools/perf/Makefile | 83 |
1 files changed, 29 insertions, 54 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index e5e71e7d95a0..f9126f89efef 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -45,6 +45,8 @@ include config/utilities.mak | |||
| 45 | # | 45 | # |
| 46 | # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf | 46 | # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf |
| 47 | # backtrace post unwind. | 47 | # backtrace post unwind. |
| 48 | # | ||
| 49 | # Define NO_BACKTRACE if you do not want stack backtrace debug feature | ||
| 48 | 50 | ||
| 49 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE | 51 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE |
| 50 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 52 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
| @@ -185,7 +187,7 @@ strip-libs = $(filter-out -l%,$(1)) | |||
| 185 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) | 187 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) |
| 186 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py | 188 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py |
| 187 | 189 | ||
| 188 | $(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) | 190 | $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) |
| 189 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ | 191 | $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ |
| 190 | --quiet build_ext; \ | 192 | --quiet build_ext; \ |
| 191 | mkdir -p $(OUTPUT)python && \ | 193 | mkdir -p $(OUTPUT)python && \ |
| @@ -446,20 +448,6 @@ BUILTIN_OBJS += $(OUTPUT)builtin-inject.o | |||
| 446 | 448 | ||
| 447 | PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT) | 449 | PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT) |
| 448 | 450 | ||
| 449 | # Files needed for the python binding, perf.so | ||
| 450 | # pyrf is just an internal name needed for all those wrappers. | ||
| 451 | # This has to be in sync with what is in the 'sources' variable in | ||
| 452 | # tools/perf/util/setup.py | ||
| 453 | |||
| 454 | PYRF_OBJS += $(OUTPUT)util/cpumap.o | ||
| 455 | PYRF_OBJS += $(OUTPUT)util/ctype.o | ||
| 456 | PYRF_OBJS += $(OUTPUT)util/evlist.o | ||
| 457 | PYRF_OBJS += $(OUTPUT)util/evsel.o | ||
| 458 | PYRF_OBJS += $(OUTPUT)util/python.o | ||
| 459 | PYRF_OBJS += $(OUTPUT)util/thread_map.o | ||
| 460 | PYRF_OBJS += $(OUTPUT)util/util.o | ||
| 461 | PYRF_OBJS += $(OUTPUT)util/xyarray.o | ||
| 462 | |||
| 463 | # | 451 | # |
| 464 | # Platform specific tweaks | 452 | # Platform specific tweaks |
| 465 | # | 453 | # |
| @@ -486,7 +474,13 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) | |||
| 486 | NO_DWARF := 1 | 474 | NO_DWARF := 1 |
| 487 | NO_DEMANGLE := 1 | 475 | NO_DEMANGLE := 1 |
| 488 | endif | 476 | endif |
| 489 | endif | 477 | else |
| 478 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | ||
| 479 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) | ||
| 480 | 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); | ||
| 481 | NO_DWARF := 1 | ||
| 482 | endif # Dwarf support | ||
| 483 | endif # SOURCE_LIBELF | ||
| 490 | endif # NO_LIBELF | 484 | endif # NO_LIBELF |
| 491 | 485 | ||
| 492 | ifndef NO_LIBUNWIND | 486 | ifndef NO_LIBUNWIND |
| @@ -511,8 +505,6 @@ ifneq ($(OUTPUT),) | |||
| 511 | endif | 505 | endif |
| 512 | 506 | ||
| 513 | ifdef NO_LIBELF | 507 | ifdef NO_LIBELF |
| 514 | BASIC_CFLAGS += -DNO_LIBELF_SUPPORT | ||
| 515 | |||
| 516 | EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) | 508 | EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) |
| 517 | 509 | ||
| 518 | # Remove ELF/DWARF dependent codes | 510 | # Remove ELF/DWARF dependent codes |
| @@ -527,17 +519,12 @@ BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS)) | |||
| 527 | LIB_OBJS += $(OUTPUT)util/symbol-minimal.o | 519 | LIB_OBJS += $(OUTPUT)util/symbol-minimal.o |
| 528 | 520 | ||
| 529 | else # NO_LIBELF | 521 | else # NO_LIBELF |
| 522 | BASIC_CFLAGS += -DLIBELF_SUPPORT | ||
| 530 | 523 | ||
| 531 | ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) | 524 | ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) |
| 532 | BASIC_CFLAGS += -DLIBELF_NO_MMAP | 525 | BASIC_CFLAGS += -DLIBELF_MMAP |
| 533 | endif | 526 | endif |
| 534 | 527 | ||
| 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 | |||
| 541 | ifndef NO_DWARF | 528 | ifndef NO_DWARF |
| 542 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 529 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
| 543 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 530 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); |
| @@ -550,38 +537,33 @@ endif # PERF_HAVE_DWARF_REGS | |||
| 550 | endif # NO_DWARF | 537 | endif # NO_DWARF |
| 551 | endif # NO_LIBELF | 538 | endif # NO_LIBELF |
| 552 | 539 | ||
| 553 | ifdef NO_LIBUNWIND | 540 | ifndef NO_LIBUNWIND |
| 554 | BASIC_CFLAGS += -DNO_LIBUNWIND_SUPPORT | 541 | BASIC_CFLAGS += -DLIBUNWIND_SUPPORT |
| 555 | else | ||
| 556 | EXTLIBS += $(LIBUNWIND_LIBS) | 542 | EXTLIBS += $(LIBUNWIND_LIBS) |
| 557 | BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS) | 543 | BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS) |
| 558 | BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS) | 544 | BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS) |
| 559 | LIB_OBJS += $(OUTPUT)util/unwind.o | 545 | LIB_OBJS += $(OUTPUT)util/unwind.o |
| 560 | endif | 546 | endif |
| 561 | 547 | ||
| 562 | ifdef NO_LIBAUDIT | 548 | ifndef NO_LIBAUDIT |
| 563 | BASIC_CFLAGS += -DNO_LIBAUDIT_SUPPORT | ||
| 564 | else | ||
| 565 | FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit | 549 | FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit |
| 566 | ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT)),y) | 550 | 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); | 551 | 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 | 552 | else |
| 553 | BASIC_CFLAGS += -DLIBAUDIT_SUPPORT | ||
| 570 | BUILTIN_OBJS += $(OUTPUT)builtin-trace.o | 554 | BUILTIN_OBJS += $(OUTPUT)builtin-trace.o |
| 571 | EXTLIBS += -laudit | 555 | EXTLIBS += -laudit |
| 572 | endif | 556 | endif |
| 573 | endif | 557 | endif |
| 574 | 558 | ||
| 575 | ifdef NO_NEWT | 559 | ifndef NO_NEWT |
| 576 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT | ||
| 577 | else | ||
| 578 | FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt | 560 | FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt |
| 579 | ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y) | 561 | ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y) |
| 580 | msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); | 562 | msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); |
| 581 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT | ||
| 582 | else | 563 | else |
| 583 | # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h | 564 | # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h |
| 584 | BASIC_CFLAGS += -I/usr/include/slang | 565 | BASIC_CFLAGS += -I/usr/include/slang |
| 566 | BASIC_CFLAGS += -DNEWT_SUPPORT | ||
| 585 | EXTLIBS += -lnewt -lslang | 567 | EXTLIBS += -lnewt -lslang |
| 586 | LIB_OBJS += $(OUTPUT)ui/setup.o | 568 | LIB_OBJS += $(OUTPUT)ui/setup.o |
| 587 | LIB_OBJS += $(OUTPUT)ui/browser.o | 569 | LIB_OBJS += $(OUTPUT)ui/browser.o |
| @@ -603,17 +585,15 @@ else | |||
| 603 | endif | 585 | endif |
| 604 | endif | 586 | endif |
| 605 | 587 | ||
| 606 | ifdef NO_GTK2 | 588 | ifndef NO_GTK2 |
| 607 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT | ||
| 608 | else | ||
| 609 | FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) | 589 | FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 610 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y) | 590 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y) |
| 611 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); | 591 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); |
| 612 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT | ||
| 613 | else | 592 | else |
| 614 | ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y) | 593 | ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y) |
| 615 | BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR | 594 | BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR |
| 616 | endif | 595 | endif |
| 596 | BASIC_CFLAGS += -DGTK2_SUPPORT | ||
| 617 | BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) | 597 | BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) |
| 618 | EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) | 598 | EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) |
| 619 | LIB_OBJS += $(OUTPUT)ui/gtk/browser.o | 599 | LIB_OBJS += $(OUTPUT)ui/gtk/browser.o |
| @@ -621,7 +601,7 @@ else | |||
| 621 | LIB_OBJS += $(OUTPUT)ui/gtk/util.o | 601 | LIB_OBJS += $(OUTPUT)ui/gtk/util.o |
| 622 | LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o | 602 | LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o |
| 623 | # Make sure that it'd be included only once. | 603 | # Make sure that it'd be included only once. |
| 624 | ifneq ($(findstring -DNO_NEWT_SUPPORT,$(BASIC_CFLAGS)),) | 604 | ifeq ($(findstring -DNEWT_SUPPORT,$(BASIC_CFLAGS)),) |
| 625 | LIB_OBJS += $(OUTPUT)ui/setup.o | 605 | LIB_OBJS += $(OUTPUT)ui/setup.o |
| 626 | LIB_OBJS += $(OUTPUT)ui/util.o | 606 | LIB_OBJS += $(OUTPUT)ui/util.o |
| 627 | endif | 607 | endif |
| @@ -762,23 +742,18 @@ ifeq ($(NO_PERF_REGS),0) | |||
| 762 | ifeq ($(ARCH),x86) | 742 | ifeq ($(ARCH),x86) |
| 763 | LIB_H += arch/x86/include/perf_regs.h | 743 | LIB_H += arch/x86/include/perf_regs.h |
| 764 | endif | 744 | endif |
| 765 | else | 745 | BASIC_CFLAGS += -DHAVE_PERF_REGS |
| 766 | BASIC_CFLAGS += -DNO_PERF_REGS | ||
| 767 | endif | 746 | endif |
| 768 | 747 | ||
| 769 | ifdef NO_STRLCPY | 748 | ifndef NO_STRLCPY |
| 770 | BASIC_CFLAGS += -DNO_STRLCPY | 749 | ifeq ($(call try-cc,$(SOURCE_STRLCPY),),y) |
| 771 | else | 750 | BASIC_CFLAGS += -DHAVE_STRLCPY |
| 772 | ifneq ($(call try-cc,$(SOURCE_STRLCPY),),y) | ||
| 773 | BASIC_CFLAGS += -DNO_STRLCPY | ||
| 774 | endif | 751 | endif |
| 775 | endif | 752 | endif |
| 776 | 753 | ||
| 777 | ifdef NO_BACKTRACE | 754 | ifndef NO_BACKTRACE |
| 778 | BASIC_CFLAGS += -DNO_BACKTRACE | 755 | ifeq ($(call try-cc,$(SOURCE_BACKTRACE),),y) |
| 779 | else | 756 | BASIC_CFLAGS += -DBACKTRACE_SUPPORT |
| 780 | ifneq ($(call try-cc,$(SOURCE_BACKTRACE),),y) | ||
| 781 | BASIC_CFLAGS += -DNO_BACKTRACE | ||
| 782 | endif | 757 | endif |
| 783 | endif | 758 | endif |
| 784 | 759 | ||
