diff options
| author | Namhyung Kim <namhyung.kim@lge.com> | 2012-08-06 00:41:21 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-09 15:26:38 -0400 |
| commit | 393be2e3747ea3ef0d2e724115a5f42b2fa50dbd (patch) | |
| tree | 6cdc2568e3a6a485f8bbf3d0f94f83873daad3a7 /tools/perf/Makefile | |
| parent | e5a1845fc0aeca85c98115980c3531129f87e18d (diff) | |
perf symbols: Support minimal build without libelf
Now we have isolated all ELF-specific stuff, it's possible to build
without libelf. The output binary can do most of jobs but lacks (user
level) symbol information - kernel symbols are still accessable thanks
to the kallsyms.
To build perf without libelf (elfutils), give NO_LIBELF=1 to make.
For now, only 'perf probe' command is removed since it depends on
libelf/libdw heavily.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1344228082-15569-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Makefile')
| -rw-r--r-- | tools/perf/Makefile | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index f790e3bf14cb..de6aa8c706cf 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -37,7 +37,12 @@ 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 | # | ||
| 41 | 46 | ||
| 42 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE | 47 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE |
| 43 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 48 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
| @@ -450,34 +455,57 @@ PYRF_OBJS += $(OUTPUT)util/xyarray.o | |||
| 450 | -include config.mak.autogen | 455 | -include config.mak.autogen |
| 451 | -include config.mak | 456 | -include config.mak |
| 452 | 457 | ||
| 453 | ifndef NO_DWARF | 458 | ifdef NO_LIBELF |
| 454 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | ||
| 455 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) | ||
| 456 | 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); | ||
| 457 | NO_DWARF := 1 | 459 | NO_DWARF := 1 |
| 458 | endif # Dwarf support | 460 | NO_DEMANGLE := 1 |
| 459 | endif # NO_DWARF | 461 | else |
| 460 | |||
| 461 | -include arch/$(ARCH)/Makefile | ||
| 462 | |||
| 463 | ifneq ($(OUTPUT),) | ||
| 464 | BASIC_CFLAGS += -I$(OUTPUT) | ||
| 465 | endif | ||
| 466 | |||
| 467 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 462 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) |
| 468 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) | 463 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) |
| 469 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) | 464 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) |
| 470 | ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) | 465 | ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) |
| 471 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | 466 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); |
| 472 | else | 467 | else |
| 473 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); | 468 | NO_LIBELF := 1 |
| 469 | NO_DWARF := 1 | ||
| 470 | NO_DEMANGLE := 1 | ||
| 474 | endif | 471 | endif |
| 475 | endif | 472 | endif |
| 473 | endif # NO_LIBELF | ||
| 474 | |||
| 475 | -include arch/$(ARCH)/Makefile | ||
| 476 | |||
| 477 | ifneq ($(OUTPUT),) | ||
| 478 | BASIC_CFLAGS += -I$(OUTPUT) | ||
| 479 | endif | ||
| 480 | |||
| 481 | ifdef NO_LIBELF | ||
| 482 | BASIC_CFLAGS += -DNO_LIBELF_SUPPORT | ||
| 483 | |||
| 484 | EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) | ||
| 485 | |||
| 486 | # Remove ELF/DWARF dependent codes | ||
| 487 | LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS)) | ||
| 488 | LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS)) | ||
| 489 | LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS)) | ||
| 490 | LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS)) | ||
| 491 | |||
| 492 | BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS)) | ||
| 493 | |||
| 494 | # Use minimal symbol handling | ||
| 495 | LIB_OBJS += $(OUTPUT)util/symbol-minimal.o | ||
| 496 | |||
| 497 | else # NO_LIBELF | ||
| 476 | 498 | ||
| 477 | ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) | 499 | ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) |
| 478 | BASIC_CFLAGS += -DLIBELF_NO_MMAP | 500 | BASIC_CFLAGS += -DLIBELF_NO_MMAP |
| 479 | endif | 501 | endif |
| 480 | 502 | ||
| 503 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | ||
| 504 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) | ||
| 505 | 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); | ||
| 506 | NO_DWARF := 1 | ||
| 507 | endif # Dwarf support | ||
| 508 | |||
| 481 | ifndef NO_DWARF | 509 | ifndef NO_DWARF |
| 482 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 510 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
| 483 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 511 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); |
| @@ -488,6 +516,7 @@ else | |||
| 488 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o | 516 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o |
| 489 | endif # PERF_HAVE_DWARF_REGS | 517 | endif # PERF_HAVE_DWARF_REGS |
| 490 | endif # NO_DWARF | 518 | endif # NO_DWARF |
| 519 | endif # NO_LIBELF | ||
| 491 | 520 | ||
| 492 | ifdef NO_NEWT | 521 | ifdef NO_NEWT |
| 493 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT | 522 | BASIC_CFLAGS += -DNO_NEWT_SUPPORT |
