diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-05-01 02:24:39 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-05-01 02:24:39 -0400 |
| commit | aeffe2abc894b585acbe0923c0d4f21b4c5c1035 (patch) | |
| tree | ad712872dba8b8b1aa159fdb0f6dc7cc0ab5f9c6 /tools | |
| parent | 201131998fbf074b03679afedcc29948e63331ef (diff) | |
| parent | 399f0c220a0ee97a5a9ea1a699a58fe2aacf2983 (diff) | |
Merge branch 'perf/urgent' into perf/core, to resolve conflict
Conflicts:
tools/perf/arch/x86/tests/dwarf-unwind.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/lib/api/fs/debugfs.c | 4 | ||||
| -rw-r--r-- | tools/perf/Makefile.perf | 2 | ||||
| -rw-r--r-- | tools/perf/arch/x86/tests/dwarf-unwind.c | 2 | ||||
| -rw-r--r-- | tools/perf/arch/x86/tests/regs_load.S | 8 | ||||
| -rw-r--r-- | tools/perf/config/Makefile | 38 | ||||
| -rw-r--r-- | tools/perf/tests/make | 2 | ||||
| -rw-r--r-- | tools/perf/util/machine.c | 16 |
7 files changed, 52 insertions, 20 deletions
diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c index 7c4347962353..a74fba6d7743 100644 --- a/tools/lib/api/fs/debugfs.c +++ b/tools/lib/api/fs/debugfs.c | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug"; | 12 | char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug"; |
| 13 | 13 | ||
| 14 | static const char * const debugfs_known_mountpoints[] = { | 14 | static const char * const debugfs_known_mountpoints[] = { |
| 15 | "/sys/kernel/debug/", | 15 | "/sys/kernel/debug", |
| 16 | "/debug/", | 16 | "/debug", |
| 17 | 0, | 17 | 0, |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 46e0c32ad23b..5e21aad44142 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
| @@ -593,7 +593,7 @@ $(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H) | |||
| 593 | $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $< | 593 | $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $< |
| 594 | 594 | ||
| 595 | $(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS) | 595 | $(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS) |
| 596 | $(QUIET_LINK)$(CC) -o $@ -shared $(ALL_LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) | 596 | $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) |
| 597 | 597 | ||
| 598 | $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS | 598 | $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS |
| 599 | $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \ | 599 | $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \ |
diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c index c916656259f7..9f89f899ccc7 100644 --- a/tools/perf/arch/x86/tests/dwarf-unwind.c +++ b/tools/perf/arch/x86/tests/dwarf-unwind.c | |||
| @@ -23,7 +23,7 @@ static int sample_ustack(struct perf_sample *sample, | |||
| 23 | 23 | ||
| 24 | sp = (unsigned long) regs[PERF_REG_X86_SP]; | 24 | sp = (unsigned long) regs[PERF_REG_X86_SP]; |
| 25 | 25 | ||
| 26 | map = map_groups__find(thread->mg, MAP__FUNCTION, (u64) sp); | 26 | map = map_groups__find(thread->mg, MAP__VARIABLE, (u64) sp); |
| 27 | if (!map) { | 27 | if (!map) { |
| 28 | pr_debug("failed to get stack map\n"); | 28 | pr_debug("failed to get stack map\n"); |
| 29 | free(buf); | 29 | free(buf); |
diff --git a/tools/perf/arch/x86/tests/regs_load.S b/tools/perf/arch/x86/tests/regs_load.S index 99167bf644ea..60875d5c556c 100644 --- a/tools/perf/arch/x86/tests/regs_load.S +++ b/tools/perf/arch/x86/tests/regs_load.S | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | #include <linux/linkage.h> | 1 | #include <linux/linkage.h> |
| 3 | 2 | ||
| 4 | #define AX 0 | 3 | #define AX 0 |
| @@ -90,3 +89,10 @@ ENTRY(perf_regs_load) | |||
| 90 | ret | 89 | ret |
| 91 | ENDPROC(perf_regs_load) | 90 | ENDPROC(perf_regs_load) |
| 92 | #endif | 91 | #endif |
| 92 | |||
| 93 | /* | ||
| 94 | * We need to provide note.GNU-stack section, saying that we want | ||
| 95 | * NOT executable stack. Otherwise the final linking will assume that | ||
| 96 | * the ELF stack should not be restricted at all and set it RWX. | ||
| 97 | */ | ||
| 98 | .section .note.GNU-stack,"",@progbits | ||
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index a71fb395e38f..802cf544202b 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
| @@ -117,6 +117,10 @@ CFLAGS += -Wall | |||
| 117 | CFLAGS += -Wextra | 117 | CFLAGS += -Wextra |
| 118 | CFLAGS += -std=gnu99 | 118 | CFLAGS += -std=gnu99 |
| 119 | 119 | ||
| 120 | # Enforce a non-executable stack, as we may regress (again) in the future by | ||
| 121 | # adding assembler files missing the .GNU-stack linker note. | ||
| 122 | LDFLAGS += -Wl,-z,noexecstack | ||
| 123 | |||
| 120 | EXTLIBS = -lelf -lpthread -lrt -lm -ldl | 124 | EXTLIBS = -lelf -lpthread -lrt -lm -ldl |
| 121 | 125 | ||
| 122 | ifneq ($(OUTPUT),) | 126 | ifneq ($(OUTPUT),) |
| @@ -194,7 +198,10 @@ VF_FEATURE_TESTS = \ | |||
| 194 | stackprotector-all \ | 198 | stackprotector-all \ |
| 195 | timerfd \ | 199 | timerfd \ |
| 196 | libunwind-debug-frame \ | 200 | libunwind-debug-frame \ |
| 197 | bionic | 201 | bionic \ |
| 202 | liberty \ | ||
| 203 | liberty-z \ | ||
| 204 | cplus-demangle | ||
| 198 | 205 | ||
| 199 | # Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features. | 206 | # Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features. |
| 200 | # If in the future we need per-feature checks/flags for features not | 207 | # If in the future we need per-feature checks/flags for features not |
| @@ -512,7 +519,21 @@ else | |||
| 512 | endif | 519 | endif |
| 513 | 520 | ||
| 514 | ifeq ($(feature-libbfd), 1) | 521 | ifeq ($(feature-libbfd), 1) |
| 515 | EXTLIBS += -lbfd -lz -liberty | 522 | EXTLIBS += -lbfd |
| 523 | |||
| 524 | # call all detections now so we get correct | ||
| 525 | # status in VF output | ||
| 526 | $(call feature_check,liberty) | ||
| 527 | $(call feature_check,liberty-z) | ||
| 528 | $(call feature_check,cplus-demangle) | ||
| 529 | |||
| 530 | ifeq ($(feature-liberty), 1) | ||
| 531 | EXTLIBS += -liberty | ||
| 532 | else | ||
| 533 | ifeq ($(feature-liberty-z), 1) | ||
| 534 | EXTLIBS += -liberty -lz | ||
| 535 | endif | ||
| 536 | endif | ||
| 516 | endif | 537 | endif |
| 517 | 538 | ||
| 518 | ifdef NO_DEMANGLE | 539 | ifdef NO_DEMANGLE |
| @@ -523,15 +544,10 @@ else | |||
| 523 | CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT | 544 | CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT |
| 524 | else | 545 | else |
| 525 | ifneq ($(feature-libbfd), 1) | 546 | ifneq ($(feature-libbfd), 1) |
| 526 | $(call feature_check,liberty) | 547 | ifneq ($(feature-liberty), 1) |
| 527 | ifeq ($(feature-liberty), 1) | 548 | ifneq ($(feature-liberty-z), 1) |
| 528 | EXTLIBS += -lbfd -liberty | 549 | # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT |
| 529 | else | 550 | # or any of 'bfd iberty z' trinity |
| 530 | $(call feature_check,liberty-z) | ||
| 531 | ifeq ($(feature-liberty-z), 1) | ||
| 532 | EXTLIBS += -lbfd -liberty -lz | ||
| 533 | else | ||
| 534 | $(call feature_check,cplus-demangle) | ||
| 535 | ifeq ($(feature-cplus-demangle), 1) | 551 | ifeq ($(feature-cplus-demangle), 1) |
| 536 | EXTLIBS += -liberty | 552 | EXTLIBS += -liberty |
| 537 | CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT | 553 | CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT |
diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 5daeae1cb4c0..2f92d6e7ee00 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make | |||
| @@ -46,6 +46,7 @@ make_install_man := install-man | |||
| 46 | make_install_html := install-html | 46 | make_install_html := install-html |
| 47 | make_install_info := install-info | 47 | make_install_info := install-info |
| 48 | make_install_pdf := install-pdf | 48 | make_install_pdf := install-pdf |
| 49 | make_static := LDFLAGS=-static | ||
| 49 | 50 | ||
| 50 | # all the NO_* variable combined | 51 | # all the NO_* variable combined |
| 51 | make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 | 52 | make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 |
| @@ -87,6 +88,7 @@ run += make_install_bin | |||
| 87 | # run += make_install_info | 88 | # run += make_install_info |
| 88 | # run += make_install_pdf | 89 | # run += make_install_pdf |
| 89 | run += make_minimal | 90 | run += make_minimal |
| 91 | run += make_static | ||
| 90 | 92 | ||
| 91 | ifneq ($(call has,ctags),) | 93 | ifneq ($(call has,ctags),) |
| 92 | run += make_tags | 94 | run += make_tags |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 98ec56dc890b..7409ac8de51c 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
| @@ -728,7 +728,7 @@ static char *get_kernel_version(const char *root_dir) | |||
| 728 | } | 728 | } |
| 729 | 729 | ||
| 730 | static int map_groups__set_modules_path_dir(struct map_groups *mg, | 730 | static int map_groups__set_modules_path_dir(struct map_groups *mg, |
| 731 | const char *dir_name) | 731 | const char *dir_name, int depth) |
| 732 | { | 732 | { |
| 733 | struct dirent *dent; | 733 | struct dirent *dent; |
| 734 | DIR *dir = opendir(dir_name); | 734 | DIR *dir = opendir(dir_name); |
| @@ -753,7 +753,15 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, | |||
| 753 | !strcmp(dent->d_name, "..")) | 753 | !strcmp(dent->d_name, "..")) |
| 754 | continue; | 754 | continue; |
| 755 | 755 | ||
| 756 | ret = map_groups__set_modules_path_dir(mg, path); | 756 | /* Do not follow top-level source and build symlinks */ |
| 757 | if (depth == 0) { | ||
| 758 | if (!strcmp(dent->d_name, "source") || | ||
| 759 | !strcmp(dent->d_name, "build")) | ||
| 760 | continue; | ||
| 761 | } | ||
| 762 | |||
| 763 | ret = map_groups__set_modules_path_dir(mg, path, | ||
| 764 | depth + 1); | ||
| 757 | if (ret < 0) | 765 | if (ret < 0) |
| 758 | goto out; | 766 | goto out; |
| 759 | } else { | 767 | } else { |
| @@ -797,11 +805,11 @@ static int machine__set_modules_path(struct machine *machine) | |||
| 797 | if (!version) | 805 | if (!version) |
| 798 | return -1; | 806 | return -1; |
| 799 | 807 | ||
| 800 | snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s/kernel", | 808 | snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s", |
| 801 | machine->root_dir, version); | 809 | machine->root_dir, version); |
| 802 | free(version); | 810 | free(version); |
| 803 | 811 | ||
| 804 | return map_groups__set_modules_path_dir(&machine->kmaps, modules_path); | 812 | return map_groups__set_modules_path_dir(&machine->kmaps, modules_path, 0); |
| 805 | } | 813 | } |
| 806 | 814 | ||
| 807 | static int machine__create_module(void *arg, const char *name, u64 start) | 815 | static int machine__create_module(void *arg, const char *name, u64 start) |
