aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-11-13 13:05:09 -0500
committerIngo Molnar <mingo@kernel.org>2012-11-13 13:13:41 -0500
commitccf59d8da119ab03dcbdf95fb5e5adcef6ba51f2 (patch)
treed390f9230edac3d9c42a8ad8b030182890b6e609 /tools/perf/Makefile
parent95d18aa2b6c05351181934b3bc34ce038cc7b637 (diff)
parent27f94d52394003d444a383eaf8d4824daf32432e (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Don't show scripts menu for 'perf top', fix from Feng Tang * Add framework for automated perf_event_attr tests, where tools with different command line options will be run from a 'perf test', via python glue, and the perf syscall will be intercepted to verify that the perf_event_attr fields set by the tool are those expected, from Jiri Olsa * Use normalized arch name for searching objdump path. This fixes cases where the system's objdump (e.g. x86_64) supports the architecture in the perf.data file (e.g. i686), but is not the same, fix from Namhyung Kim. * Postpone objdump check until annotation requested, from Namhyung Kim. * Add a 'link' method for hists, so that we can have the leader with buckets for all the entries in all the hists. This new method is now used in the default 'diff' output, making the sum of the 'baseline' column be 100%, eliminating blind spots. Now we need to use this for 'diff' with > 2 perf.data files and for multi event 'report' and 'annotate'. * libtraceevent fixes for compiler warnings trying to make perf it build on some distros, like fedora 14, 32-bit, some of the warnings really pointed to real bugs. * Remove temp dir on failure in 'perf test', fix from Jiri Olsa. * Fixes for handling data, stack mmaps, from Namhyung Kim. * Fix live annotation bug related to recent objdump lookup patches, from Namhyung Kim * Don't try to follow jump target on PLT symbols in the annotation browser, fix from Namhyung Kim. * Fix leak on hist_entry delete, from Namhyung Kim. * Fix a CPU_ALLOC related build error on builtin-test, from Zheng Liu. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile34
1 files changed, 27 insertions, 7 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7e25f59e5e89..cca5bb8334ad 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -169,7 +169,7 @@ endif
169 169
170### --- END CONFIGURATION SECTION --- 170### --- END CONFIGURATION SECTION ---
171 171
172BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 172BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -Iutil -I. -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
173BASIC_LDFLAGS = 173BASIC_LDFLAGS =
174 174
175ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) 175ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
@@ -371,7 +371,6 @@ LIB_OBJS += $(OUTPUT)util/help.o
371LIB_OBJS += $(OUTPUT)util/levenshtein.o 371LIB_OBJS += $(OUTPUT)util/levenshtein.o
372LIB_OBJS += $(OUTPUT)util/parse-options.o 372LIB_OBJS += $(OUTPUT)util/parse-options.o
373LIB_OBJS += $(OUTPUT)util/parse-events.o 373LIB_OBJS += $(OUTPUT)util/parse-events.o
374LIB_OBJS += $(OUTPUT)util/parse-events-test.o
375LIB_OBJS += $(OUTPUT)util/path.o 374LIB_OBJS += $(OUTPUT)util/path.o
376LIB_OBJS += $(OUTPUT)util/rbtree.o 375LIB_OBJS += $(OUTPUT)util/rbtree.o
377LIB_OBJS += $(OUTPUT)util/bitmap.o 376LIB_OBJS += $(OUTPUT)util/bitmap.o
@@ -389,7 +388,6 @@ LIB_OBJS += $(OUTPUT)util/sigchain.o
389LIB_OBJS += $(OUTPUT)util/dso.o 388LIB_OBJS += $(OUTPUT)util/dso.o
390LIB_OBJS += $(OUTPUT)util/symbol.o 389LIB_OBJS += $(OUTPUT)util/symbol.o
391LIB_OBJS += $(OUTPUT)util/symbol-elf.o 390LIB_OBJS += $(OUTPUT)util/symbol-elf.o
392LIB_OBJS += $(OUTPUT)util/dso-test-data.o
393LIB_OBJS += $(OUTPUT)util/color.o 391LIB_OBJS += $(OUTPUT)util/color.o
394LIB_OBJS += $(OUTPUT)util/pager.o 392LIB_OBJS += $(OUTPUT)util/pager.o
395LIB_OBJS += $(OUTPUT)util/header.o 393LIB_OBJS += $(OUTPUT)util/header.o
@@ -430,6 +428,10 @@ LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
430 428
431LIB_OBJS += $(OUTPUT)arch/common.o 429LIB_OBJS += $(OUTPUT)arch/common.o
432 430
431LIB_OBJS += $(OUTPUT)tests/parse-events.o
432LIB_OBJS += $(OUTPUT)tests/dso-data.o
433LIB_OBJS += $(OUTPUT)tests/attr.o
434
433BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o 435BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
434BUILTIN_OBJS += $(OUTPUT)builtin-bench.o 436BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
435# Benchmark modules 437# Benchmark modules
@@ -459,8 +461,8 @@ BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
459BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o 461BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
460BUILTIN_OBJS += $(OUTPUT)builtin-lock.o 462BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
461BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o 463BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
462BUILTIN_OBJS += $(OUTPUT)builtin-test.o
463BUILTIN_OBJS += $(OUTPUT)builtin-inject.o 464BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
465BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
464 466
465PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT) 467PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT)
466 468
@@ -490,6 +492,8 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
490 LIBC_SUPPORT := 1 492 LIBC_SUPPORT := 1
491 endif 493 endif
492 ifeq ($(LIBC_SUPPORT),1) 494 ifeq ($(LIBC_SUPPORT),1)
495 msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
496
493 NO_LIBELF := 1 497 NO_LIBELF := 1
494 NO_DWARF := 1 498 NO_DWARF := 1
495 NO_DEMANGLE := 1 499 NO_DEMANGLE := 1
@@ -497,7 +501,14 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
497 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); 501 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
498 endif 502 endif
499else 503else
500 FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) 504 # for linking with debug library, run like:
505 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
506 ifdef LIBDW_DIR
507 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
508 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
509 endif
510
511 FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
501 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) 512 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
502 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); 513 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);
503 NO_DWARF := 1 514 NO_DWARF := 1
@@ -552,7 +563,8 @@ ifndef NO_DWARF
552ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) 563ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
553 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); 564 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
554else 565else
555 BASIC_CFLAGS += -DDWARF_SUPPORT 566 BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS)
567 BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
556 EXTLIBS += -lelf -ldw 568 EXTLIBS += -lelf -ldw
557 LIB_OBJS += $(OUTPUT)util/probe-finder.o 569 LIB_OBJS += $(OUTPUT)util/probe-finder.o
558 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o 570 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
@@ -891,10 +903,14 @@ $(OUTPUT)%.s: %.S
891$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS 903$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
892 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 904 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
893 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \ 905 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
894 '-DBINDIR="$(bindir_relative_SQ)"' \
895 '-DPREFIX="$(prefix_SQ)"' \ 906 '-DPREFIX="$(prefix_SQ)"' \
896 $< 907 $<
897 908
909$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
910 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
911 '-DBINDIR="$(bindir_SQ)"' \
912 $<
913
898$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS 914$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
899 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 915 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
900 916
@@ -1059,6 +1075,10 @@ install: all try-install-man
1059 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' 1075 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
1060 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d' 1076 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
1061 $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf' 1077 $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
1078 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
1079 $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
1080 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
1081 $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
1062 1082
1063install-python_ext: 1083install-python_ext:
1064 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' 1084 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'