···23232424 sp = (unsigned long) regs[PERF_REG_X86_SP];25252626- map = map_groups__find(thread->mg, MAP__FUNCTION, (u64) sp);2626+ map = map_groups__find(thread->mg, MAP__VARIABLE, (u64) sp);2727 if (!map) {2828 pr_debug("failed to get stack map\n");2929 free(buf);
+7-1
tools/perf/arch/x86/tests/regs_load.S
···11-21#include <linux/linkage.h>3243#define AX 0···8990 ret9091ENDPROC(perf_regs_load)9192#endif9393+9494+/*9595+ * We need to provide note.GNU-stack section, saying that we want9696+ * NOT executable stack. Otherwise the final linking will assume that9797+ * the ELF stack should not be restricted at all and set it RWX.9898+ */9999+.section .note.GNU-stack,"",@progbits
+27-11
tools/perf/config/Makefile
···117117CFLAGS += -Wextra118118CFLAGS += -std=gnu99119119120120+# Enforce a non-executable stack, as we may regress (again) in the future by121121+# adding assembler files missing the .GNU-stack linker note.122122+LDFLAGS += -Wl,-z,noexecstack123123+120124EXTLIBS = -lelf -lpthread -lrt -lm -ldl121125122126ifneq ($(OUTPUT),)···198194 stackprotector-all \199195 timerfd \200196 libunwind-debug-frame \201201- bionic197197+ bionic \198198+ liberty \199199+ liberty-z \200200+ cplus-demangle202201203202# Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features.204203# If in the future we need per-feature checks/flags for features not···519512endif520513521514ifeq ($(feature-libbfd), 1)522522- EXTLIBS += -lbfd -lz -liberty515515+ EXTLIBS += -lbfd516516+517517+ # call all detections now so we get correct518518+ # status in VF output519519+ $(call feature_check,liberty)520520+ $(call feature_check,liberty-z)521521+ $(call feature_check,cplus-demangle)522522+523523+ ifeq ($(feature-liberty), 1)524524+ EXTLIBS += -liberty525525+ else526526+ ifeq ($(feature-liberty-z), 1)527527+ EXTLIBS += -liberty -lz528528+ endif529529+ endif523530endif524531525532ifdef NO_DEMANGLE···544523 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT545524 else546525 ifneq ($(feature-libbfd), 1)547547- $(call feature_check,liberty)548548- ifeq ($(feature-liberty), 1)549549- EXTLIBS += -lbfd -liberty550550- else551551- $(call feature_check,liberty-z)552552- ifeq ($(feature-liberty-z), 1)553553- EXTLIBS += -lbfd -liberty -lz554554- else555555- $(call feature_check,cplus-demangle)526526+ ifneq ($(feature-liberty), 1)527527+ ifneq ($(feature-liberty-z), 1)528528+ # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT529529+ # or any of 'bfd iberty z' trinity556530 ifeq ($(feature-cplus-demangle), 1)557531 EXTLIBS += -liberty558532 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
+2
tools/perf/tests/make
···4646make_install_html := install-html4747make_install_info := install-info4848make_install_pdf := install-pdf4949+make_static := LDFLAGS=-static49505051# all the NO_* variable combined5152make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1···8887# run += make_install_info8988# run += make_install_pdf9089run += make_minimal9090+run += make_static91919292ifneq ($(call has,ctags),)9393run += make_tags
+12-4
tools/perf/util/machine.c
···728728}729729730730static int map_groups__set_modules_path_dir(struct map_groups *mg,731731- const char *dir_name)731731+ const char *dir_name, int depth)732732{733733 struct dirent *dent;734734 DIR *dir = opendir(dir_name);···753753 !strcmp(dent->d_name, ".."))754754 continue;755755756756- ret = map_groups__set_modules_path_dir(mg, path);756756+ /* Do not follow top-level source and build symlinks */757757+ if (depth == 0) {758758+ if (!strcmp(dent->d_name, "source") ||759759+ !strcmp(dent->d_name, "build"))760760+ continue;761761+ }762762+763763+ ret = map_groups__set_modules_path_dir(mg, path,764764+ depth + 1);757765 if (ret < 0)758766 goto out;759767 } else {···805797 if (!version)806798 return -1;807799808808- snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s/kernel",800800+ snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s",809801 machine->root_dir, version);810802 free(version);811803812812- return map_groups__set_modules_path_dir(&machine->kmaps, modules_path);804804+ return map_groups__set_modules_path_dir(&machine->kmaps, modules_path, 0);813805}814806815807static int machine__create_module(void *arg, const char *name, u64 start)