diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-10-23 17:16:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-29 08:32:48 -0400 |
commit | e477f3f01a89a8fd44031e7f2ba6ffcab037336c (patch) | |
tree | 36d6011cee4ae37dd5e0340cca5c1c0a125be42e /tools/perf/config | |
parent | 42634bc7a02ead59cf2d50e60d8b8f825de8a3b0 (diff) |
perf tools: Build programs to copy 32-bit compatibility
perf tools copy VDSO out of memory. However, on 64-bit machines there
may be 32-bit compatibility VDOs also. To copy those requires separate
32-bit executables.
This patch adds to the build additional programs perf-read-vdso32 and
perf-read-vdsox32 for 32-bit and x32 respectively.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1414061124-26830-15-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/config')
-rw-r--r-- | tools/perf/config/Makefile | 25 | ||||
-rw-r--r-- | tools/perf/config/Makefile.arch | 8 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/Makefile | 10 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/test-compile.c | 4 |
4 files changed, 45 insertions, 2 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 58f609198c6d..3ba2382a5236 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -230,7 +230,9 @@ VF_FEATURE_TESTS = \ | |||
230 | bionic \ | 230 | bionic \ |
231 | liberty \ | 231 | liberty \ |
232 | liberty-z \ | 232 | liberty-z \ |
233 | cplus-demangle | 233 | cplus-demangle \ |
234 | compile-32 \ | ||
235 | compile-x32 | ||
234 | 236 | ||
235 | # Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features. | 237 | # Set FEATURE_CHECK_(C|LD)FLAGS-all for all CORE_FEATURE_TESTS features. |
236 | # If in the future we need per-feature checks/flags for features not | 238 | # If in the future we need per-feature checks/flags for features not |
@@ -622,6 +624,27 @@ ifdef HAVE_KVM_STAT_SUPPORT | |||
622 | CFLAGS += -DHAVE_KVM_STAT_SUPPORT | 624 | CFLAGS += -DHAVE_KVM_STAT_SUPPORT |
623 | endif | 625 | endif |
624 | 626 | ||
627 | ifeq (${IS_64_BIT}, 1) | ||
628 | ifndef NO_PERF_READ_VDSO32 | ||
629 | $(call feature_check,compile-32) | ||
630 | ifneq ($(feature-compile-32), 1) | ||
631 | NO_PERF_READ_VDSO32 := 1 | ||
632 | endif | ||
633 | endif | ||
634 | ifneq (${IS_X86_64}, 1) | ||
635 | NO_PERF_READ_VDSOX32 := 1 | ||
636 | endif | ||
637 | ifndef NO_PERF_READ_VDSOX32 | ||
638 | $(call feature_check,compile-x32) | ||
639 | ifneq ($(feature-compile-x32), 1) | ||
640 | NO_PERF_READ_VDSOX32 := 1 | ||
641 | endif | ||
642 | endif | ||
643 | else | ||
644 | NO_PERF_READ_VDSO32 := 1 | ||
645 | NO_PERF_READ_VDSOX32 := 1 | ||
646 | endif | ||
647 | |||
625 | # Among the variables below, these: | 648 | # Among the variables below, these: |
626 | # perfexecdir | 649 | # perfexecdir |
627 | # template_dir | 650 | # template_dir |
diff --git a/tools/perf/config/Makefile.arch b/tools/perf/config/Makefile.arch index 4b06719ee984..851cd0172a76 100644 --- a/tools/perf/config/Makefile.arch +++ b/tools/perf/config/Makefile.arch | |||
@@ -21,3 +21,11 @@ ifeq ($(ARCH),x86_64) | |||
21 | RAW_ARCH := x86_64 | 21 | RAW_ARCH := x86_64 |
22 | endif | 22 | endif |
23 | endif | 23 | endif |
24 | |||
25 | ifeq (${IS_X86_64}, 1) | ||
26 | IS_64_BIT := 1 | ||
27 | else ifeq ($(ARCH),x86) | ||
28 | IS_64_BIT := 0 | ||
29 | else | ||
30 | IS_64_BIT := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) | ||
31 | endif | ||
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 72ab2984718e..7c68ec74a808 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
@@ -27,7 +27,9 @@ FILES= \ | |||
27 | test-libunwind-debug-frame.bin \ | 27 | test-libunwind-debug-frame.bin \ |
28 | test-stackprotector-all.bin \ | 28 | test-stackprotector-all.bin \ |
29 | test-timerfd.bin \ | 29 | test-timerfd.bin \ |
30 | test-libdw-dwarf-unwind.bin | 30 | test-libdw-dwarf-unwind.bin \ |
31 | test-compile-32.bin \ | ||
32 | test-compile-x32.bin | ||
31 | 33 | ||
32 | CC := $(CROSS_COMPILE)gcc -MD | 34 | CC := $(CROSS_COMPILE)gcc -MD |
33 | PKG_CONFIG := $(CROSS_COMPILE)pkg-config | 35 | PKG_CONFIG := $(CROSS_COMPILE)pkg-config |
@@ -131,6 +133,12 @@ test-libdw-dwarf-unwind.bin: | |||
131 | test-sync-compare-and-swap.bin: | 133 | test-sync-compare-and-swap.bin: |
132 | $(BUILD) -Werror | 134 | $(BUILD) -Werror |
133 | 135 | ||
136 | test-compile-32.bin: | ||
137 | $(CC) -m32 -o $(OUTPUT)$@ test-compile.c | ||
138 | |||
139 | test-compile-x32.bin: | ||
140 | $(CC) -mx32 -o $(OUTPUT)$@ test-compile.c | ||
141 | |||
134 | -include *.d | 142 | -include *.d |
135 | 143 | ||
136 | ############################### | 144 | ############################### |
diff --git a/tools/perf/config/feature-checks/test-compile.c b/tools/perf/config/feature-checks/test-compile.c new file mode 100644 index 000000000000..31dbf45bf99c --- /dev/null +++ b/tools/perf/config/feature-checks/test-compile.c | |||
@@ -0,0 +1,4 @@ | |||
1 | int main(void) | ||
2 | { | ||
3 | return 0; | ||
4 | } | ||