aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-10-05 04:04:33 -0400
committerIngo Molnar <mingo@kernel.org>2012-10-05 04:04:33 -0400
commitc942ee2e62dff1a7bc6f809965e93e46808d554c (patch)
tree430d4730be24416f03fd992017e47605342d9b61 /tools/perf
parente717bf4e4fe8adc519f25c4ff93ee50ed0a36710 (diff)
parent139c0815903de1a7865fe1d6beac5e995fefdf46 (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Remove several cases of needless global variables, on most builtins. * Look up thread using tid instead of pid in 'perf sched'. * Move global variables into a perf_kvm struct, from David Ahern. * Hists refactorings, preparatory for improved 'diff' command, from Jiri Olsa. * Hists refactorings, preparatory for event group viewieng work, from Namhyung Kim. * Remove double negation on optional feature macro definitions, from Namhyung Kim. * Bash auto completion improvements, now we can auto complete the tools long options, tracepoint event names, etc, from Namhyung Kim. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Makefile83
-rw-r--r--tools/perf/bash_completion50
-rw-r--r--tools/perf/builtin-buildid-cache.c58
-rw-r--r--tools/perf/builtin-buildid-list.c55
-rw-r--r--tools/perf/builtin-diff.c68
-rw-r--r--tools/perf/builtin-evlist.c21
-rw-r--r--tools/perf/builtin-help.c40
-rw-r--r--tools/perf/builtin-inject.c88
-rw-r--r--tools/perf/builtin-kmem.c66
-rw-r--r--tools/perf/builtin-kvm.c460
-rw-r--r--tools/perf/builtin-lock.c90
-rw-r--r--tools/perf/builtin-probe.c26
-rw-r--r--tools/perf/builtin-record.c27
-rw-r--r--tools/perf/builtin-report.c4
-rw-r--r--tools/perf/builtin-sched.c2
-rw-r--r--tools/perf/builtin-script.c90
-rw-r--r--tools/perf/builtin-stat.c328
-rw-r--r--tools/perf/builtin-timechart.c100
-rw-r--r--tools/perf/builtin-top.c11
-rw-r--r--tools/perf/builtin-trace.c134
-rw-r--r--tools/perf/perf.c4
-rw-r--r--tools/perf/ui/browsers/hists.c12
-rw-r--r--tools/perf/ui/gtk/browser.c6
-rw-r--r--tools/perf/ui/gtk/util.c2
-rw-r--r--tools/perf/ui/helpline.h18
-rw-r--r--tools/perf/ui/hist.c145
-rw-r--r--tools/perf/ui/setup.c2
-rw-r--r--tools/perf/ui/stdio/hist.c45
-rw-r--r--tools/perf/util/annotate.h8
-rw-r--r--tools/perf/util/cache.h38
-rw-r--r--tools/perf/util/debug.c2
-rw-r--r--tools/perf/util/debug.h17
-rw-r--r--tools/perf/util/evlist.c88
-rw-r--r--tools/perf/util/evlist.h18
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh4
-rw-r--r--tools/perf/util/hist.c66
-rw-r--r--tools/perf/util/hist.h38
-rw-r--r--tools/perf/util/map.c2
-rw-r--r--tools/perf/util/parse-options.c8
-rw-r--r--tools/perf/util/parse-options.h1
-rw-r--r--tools/perf/util/path.c2
-rw-r--r--tools/perf/util/perf_regs.h4
-rw-r--r--tools/perf/util/sort.h19
-rw-r--r--tools/perf/util/symbol.h10
-rw-r--r--tools/perf/util/unwind.h4
-rw-r--r--tools/perf/util/util.c4
46 files changed, 1193 insertions, 1175 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))
185PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) 187PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
186PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py 188PYTHON_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
447PERFLIBS = $(LIB_FILE) $(LIBTRACEEVENT) 449PERFLIBS = $(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
454PYRF_OBJS += $(OUTPUT)util/cpumap.o
455PYRF_OBJS += $(OUTPUT)util/ctype.o
456PYRF_OBJS += $(OUTPUT)util/evlist.o
457PYRF_OBJS += $(OUTPUT)util/evsel.o
458PYRF_OBJS += $(OUTPUT)util/python.o
459PYRF_OBJS += $(OUTPUT)util/thread_map.o
460PYRF_OBJS += $(OUTPUT)util/util.o
461PYRF_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
489endif 477else
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
483endif # SOURCE_LIBELF
490endif # NO_LIBELF 484endif # NO_LIBELF
491 485
492ifndef NO_LIBUNWIND 486ifndef NO_LIBUNWIND
@@ -511,8 +505,6 @@ ifneq ($(OUTPUT),)
511endif 505endif
512 506
513ifdef NO_LIBELF 507ifdef NO_LIBELF
514BASIC_CFLAGS += -DNO_LIBELF_SUPPORT
515
516EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) 508EXTLIBS := $(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))
527LIB_OBJS += $(OUTPUT)util/symbol-minimal.o 519LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
528 520
529else # NO_LIBELF 521else # NO_LIBELF
522BASIC_CFLAGS += -DLIBELF_SUPPORT
530 523
531ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) 524ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y)
532 BASIC_CFLAGS += -DLIBELF_NO_MMAP 525 BASIC_CFLAGS += -DLIBELF_MMAP
533endif 526endif
534 527
535FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
536ifneq ($(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
539endif # Dwarf support
540
541ifndef NO_DWARF 528ifndef NO_DWARF
542ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) 529ifeq ($(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
550endif # NO_DWARF 537endif # NO_DWARF
551endif # NO_LIBELF 538endif # NO_LIBELF
552 539
553ifdef NO_LIBUNWIND 540ifndef NO_LIBUNWIND
554 BASIC_CFLAGS += -DNO_LIBUNWIND_SUPPORT 541 BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
555else
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
560endif 546endif
561 547
562ifdef NO_LIBAUDIT 548ifndef NO_LIBAUDIT
563 BASIC_CFLAGS += -DNO_LIBAUDIT_SUPPORT
564else<