diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-11-20 02:32:01 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-11-20 02:32:01 -0500 |
| commit | 4e6e311e596eadba30d4f56f64eae7d45611a01c (patch) | |
| tree | 681fb4c9ae7320ab1192f92e1c153ab35c90bf8e | |
| parent | 2565711fb7d7c28e0cd93c8971b520d1b10b857c (diff) | |
| parent | a84808083688d82d7f1e5786ccf5df0ff7d448cb (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:
User visible fixes:
- Fallback to kallsyms when using the minimal 'ELF' loader (Arnaldo Carvalho de Melo)
- Fix annotation with kcore (Adrian Hunter)
- Fix up srcline histogram key formatting (Arnaldo Carvalho de Melo)
- Add missing handler for PERF_RECORD_MMAP2 events in 'perf diff' (Kan Liang)
User visible changes/new features:
- Only print base source file for srcline histogram sort key (Andi Kleen)
- Support source line numbers in annotate using a hotkey (Andi Kleen)
Infrastructure changes and fixes:
- Do not poll events that use the system_wide flag (Adrian Hunter)
- Add perf-read-vdso32 and perf-read-vdsox32 to .gitignore (Adrian Hunter)
- Only override the default :tid comm entry (Adrian Hunter)
- Factor out adding new call chain entries (Andi Kleen)
- Use al.addr to set up call chain (Andi Kleen)
- Use a common function to resolve symbol or name (Andi Kleen)
- Fix ftrace:function event recording (Jiri Olsa)
- Move disable_buildid_cache() to util/build-id.c (Namhyung Kim)
- Clean up libelf feature support code (Namhyung Kim)
- Fix typo in python 'perf test' (WANG Chao)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | tools/perf/.gitignore | 2 | ||||
| -rw-r--r-- | tools/perf/Makefile.perf | 2 | ||||
| -rw-r--r-- | tools/perf/builtin-diff.c | 1 | ||||
| -rw-r--r-- | tools/perf/config/Makefile | 5 | ||||
| -rw-r--r-- | tools/perf/tests/builtin-test.c | 2 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/annotate.c | 13 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/hists.c | 17 | ||||
| -rw-r--r-- | tools/perf/ui/gtk/hists.c | 11 | ||||
| -rw-r--r-- | tools/perf/ui/stdio/hist.c | 23 | ||||
| -rw-r--r-- | tools/perf/util/annotate.c | 32 | ||||
| -rw-r--r-- | tools/perf/util/annotate.h | 1 | ||||
| -rw-r--r-- | tools/perf/util/build-id.c | 11 | ||||
| -rw-r--r-- | tools/perf/util/build-id.h | 1 | ||||
| -rw-r--r-- | tools/perf/util/callchain.c | 19 | ||||
| -rw-r--r-- | tools/perf/util/callchain.h | 3 | ||||
| -rw-r--r-- | tools/perf/util/evlist.c | 10 | ||||
| -rw-r--r-- | tools/perf/util/evsel.c | 8 | ||||
| -rw-r--r-- | tools/perf/util/header.c | 10 | ||||
| -rw-r--r-- | tools/perf/util/machine.c | 51 | ||||
| -rw-r--r-- | tools/perf/util/sort.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/srcline.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/symbol-minimal.c | 1 | ||||
| -rw-r--r-- | tools/perf/util/thread.c | 5 | ||||
| -rw-r--r-- | tools/perf/util/util.h | 1 |
24 files changed, 145 insertions, 88 deletions
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 717221e98450..40399c3d97d6 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore | |||
| @@ -2,6 +2,8 @@ PERF-CFLAGS | |||
| 2 | PERF-GUI-VARS | 2 | PERF-GUI-VARS |
| 3 | PERF-VERSION-FILE | 3 | PERF-VERSION-FILE |
| 4 | perf | 4 | perf |
| 5 | perf-read-vdso32 | ||
| 6 | perf-read-vdsox32 | ||
| 5 | perf-help | 7 | perf-help |
| 6 | perf-record | 8 | perf-record |
| 7 | perf-report | 9 | perf-report |
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index aecf61dcd754..478efa9b2364 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
| @@ -497,8 +497,6 @@ ifneq ($(OUTPUT),) | |||
| 497 | endif | 497 | endif |
| 498 | 498 | ||
| 499 | ifdef NO_LIBELF | 499 | ifdef NO_LIBELF |
| 500 | EXTLIBS := $(filter-out -lelf,$(EXTLIBS)) | ||
| 501 | |||
| 502 | # Remove ELF/DWARF dependent codes | 500 | # Remove ELF/DWARF dependent codes |
| 503 | LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS)) | 501 | LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS)) |
| 504 | LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS)) | 502 | LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS)) |
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 25114c9a6801..1ce425d101a9 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
| @@ -357,6 +357,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused, | |||
| 357 | static struct perf_tool tool = { | 357 | static struct perf_tool tool = { |
| 358 | .sample = diff__process_sample_event, | 358 | .sample = diff__process_sample_event, |
| 359 | .mmap = perf_event__process_mmap, | 359 | .mmap = perf_event__process_mmap, |
| 360 | .mmap2 = perf_event__process_mmap2, | ||
| 360 | .comm = perf_event__process_comm, | 361 | .comm = perf_event__process_comm, |
| 361 | .exit = perf_event__process_exit, | 362 | .exit = perf_event__process_exit, |
| 362 | .fork = perf_event__process_fork, | 363 | .fork = perf_event__process_fork, |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 79f906c7124e..5d4b039fe1ed 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
| @@ -150,7 +150,7 @@ CFLAGS += -std=gnu99 | |||
| 150 | # adding assembler files missing the .GNU-stack linker note. | 150 | # adding assembler files missing the .GNU-stack linker note. |
| 151 | LDFLAGS += -Wl,-z,noexecstack | 151 | LDFLAGS += -Wl,-z,noexecstack |
| 152 | 152 | ||
| 153 | EXTLIBS = -lelf -lpthread -lrt -lm -ldl | 153 | EXTLIBS = -lpthread -lrt -lm -ldl |
| 154 | 154 | ||
| 155 | ifneq ($(OUTPUT),) | 155 | ifneq ($(OUTPUT),) |
| 156 | OUTPUT_FEATURES = $(OUTPUT)config/feature-checks/ | 156 | OUTPUT_FEATURES = $(OUTPUT)config/feature-checks/ |
| @@ -354,6 +354,7 @@ endif # NO_LIBELF | |||
| 354 | 354 | ||
| 355 | ifndef NO_LIBELF | 355 | ifndef NO_LIBELF |
| 356 | CFLAGS += -DHAVE_LIBELF_SUPPORT | 356 | CFLAGS += -DHAVE_LIBELF_SUPPORT |
| 357 | EXTLIBS += -lelf | ||
| 357 | 358 | ||
| 358 | ifeq ($(feature-libelf-mmap), 1) | 359 | ifeq ($(feature-libelf-mmap), 1) |
| 359 | CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT | 360 | CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT |
| @@ -373,7 +374,7 @@ ifndef NO_LIBELF | |||
| 373 | else | 374 | else |
| 374 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) | 375 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) |
| 375 | LDFLAGS += $(LIBDW_LDFLAGS) | 376 | LDFLAGS += $(LIBDW_LDFLAGS) |
| 376 | EXTLIBS += -lelf -ldw | 377 | EXTLIBS += -ldw |
| 377 | endif # PERF_HAVE_DWARF_REGS | 378 | endif # PERF_HAVE_DWARF_REGS |
| 378 | endif # NO_DWARF | 379 | endif # NO_DWARF |
| 379 | endif # NO_LIBELF | 380 | endif # NO_LIBELF |
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 162c978f1491..4b7d9ab0f049 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c | |||
| @@ -85,7 +85,7 @@ static struct test { | |||
| 85 | .func = test__hists_link, | 85 | .func = test__hists_link, |
| 86 | }, | 86 | }, |
| 87 | { | 87 | { |
| 88 | .desc = "Try 'use perf' in python, checking link problems", | 88 | .desc = "Try 'import perf' in python, checking link problems", |
| 89 | .func = test__python_use, | 89 | .func = test__python_use, |
| 90 | }, | 90 | }, |
| 91 | { | 91 | { |
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index f0697a3aede0..1e0a2fd80115 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
| @@ -27,6 +27,7 @@ static struct annotate_browser_opt { | |||
| 27 | bool hide_src_code, | 27 | bool hide_src_code, |
| 28 | use_offset, | 28 | use_offset, |
| 29 | jump_arrows, | 29 | jump_arrows, |
| 30 | show_linenr, | ||
| 30 | show_nr_jumps; | 31 | show_nr_jumps; |
| 31 | } annotate_browser__opts = { | 32 | } annotate_browser__opts = { |
| 32 | .use_offset = true, | 33 | .use_offset = true, |
| @@ -128,7 +129,11 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 128 | if (!*dl->line) | 129 | if (!*dl->line) |
| 129 | slsmg_write_nstring(" ", width - pcnt_width); | 130 | slsmg_write_nstring(" ", width - pcnt_width); |
| 130 | else if (dl->offset == -1) { | 131 | else if (dl->offset == -1) { |
| 131 | printed = scnprintf(bf, sizeof(bf), "%*s ", | 132 | if (dl->line_nr && annotate_browser__opts.show_linenr) |
| 133 | printed = scnprintf(bf, sizeof(bf), "%-*d ", | ||
| 134 | ab->addr_width + 1, dl->line_nr); | ||
| 135 | else | ||
| 136 | printed = scnprintf(bf, sizeof(bf), "%*s ", | ||
| 132 | ab->addr_width, " "); | 137 | ab->addr_width, " "); |
| 133 | slsmg_write_nstring(bf, printed); | 138 | slsmg_write_nstring(bf, printed); |
| 134 | slsmg_write_nstring(dl->line, width - printed - pcnt_width + 1); | 139 | slsmg_write_nstring(dl->line, width - printed - pcnt_width + 1); |
| @@ -733,6 +738,7 @@ static int annotate_browser__run(struct annotate_browser *browser, | |||
| 733 | "o Toggle disassembler output/simplified view\n" | 738 | "o Toggle disassembler output/simplified view\n" |
| 734 | "s Toggle source code view\n" | 739 | "s Toggle source code view\n" |
| 735 | "/ Search string\n" | 740 | "/ Search string\n" |
| 741 | "k Toggle line numbers\n" | ||
| 736 | "r Run available scripts\n" | 742 | "r Run available scripts\n" |
| 737 | "? Search string backwards\n"); | 743 | "? Search string backwards\n"); |
| 738 | continue; | 744 | continue; |
| @@ -741,6 +747,10 @@ static int annotate_browser__run(struct annotate_browser *browser, | |||
| 741 | script_browse(NULL); | 747 | script_browse(NULL); |
| 742 | continue; | 748 | continue; |
| 743 | } | 749 | } |
| 750 | case 'k': | ||
| 751 | annotate_browser__opts.show_linenr = | ||
| 752 | !annotate_browser__opts.show_linenr; | ||
| 753 | break; | ||
| 744 | case 'H': | 754 | case 'H': |
| 745 | nd = browser->curr_hot; | 755 | nd = browser->curr_hot; |
| 746 | break; | 756 | break; |
| @@ -984,6 +994,7 @@ static struct annotate_config { | |||
| 984 | } annotate__configs[] = { | 994 | } annotate__configs[] = { |
| 985 | ANNOTATE_CFG(hide_src_code), | 995 | ANNOTATE_CFG(hide_src_code), |
| 986 | ANNOTATE_CFG(jump_arrows), | 996 | ANNOTATE_CFG(jump_arrows), |
| 997 | ANNOTATE_CFG(show_linenr), | ||
| 987 | ANNOTATE_CFG(show_nr_jumps), | 998 | ANNOTATE_CFG(show_nr_jumps), |
| 988 | ANNOTATE_CFG(use_offset), | 999 | ANNOTATE_CFG(use_offset), |
| 989 | }; | 1000 | }; |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index cfb976b3de3a..12c17c5a3d68 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
| @@ -463,23 +463,6 @@ out: | |||
| 463 | return key; | 463 | return key; |
| 464 | } | 464 | } |
| 465 | 465 | ||
| 466 | static char *callchain_list__sym_name(struct callchain_list *cl, | ||
| 467 | char *bf, size_t bfsize, bool show_dso) | ||
| 468 | { | ||
| 469 | int printed; | ||
| 470 | |||
| 471 | if (cl->ms.sym) | ||
| 472 | printed = scnprintf(bf, bfsi | ||
