diff options
author | Jiada Wang <jiada_wang@mentor.com> | 2017-04-09 23:02:37 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-14 14:44:29 -0400 |
commit | 7a759cd8e8272ee18922838ee711219c7c796a31 (patch) | |
tree | 0df381e719089646a34a10802587f5ab2ff332d6 /tools/perf | |
parent | 7a1ac110c22eb726684c837544a2d42c33e07be7 (diff) |
perf tools: Fix build with ARCH=x86_64
With commit: 0a943cb10ce78 (tools build: Add HOSTARCH Makefile variable)
when building for ARCH=x86_64, ARCH=x86_64 is passed to perf instead of
ARCH=x86, so the perf build process searchs header files from
tools/arch/x86_64/include, which doesn't exist.
The following build failure is seen:
In file included from util/event.c:2:0:
tools/include/uapi/linux/mman.h:4:27: fatal error: uapi/asm/mman.h: No such file or directory
compilation terminated.
Fix this issue by using SRCARCH instead of ARCH in perf, just like the
main kernel Makefile and tools/objtool's.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Rui Teng <rui.teng@linux.vnet.ibm.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 0a943cb10ce7 ("tools build: Add HOSTARCH Makefile variable")
Link: http://lkml.kernel.org/r/1491793357-14977-2-git-send-email-jiada_wang@mentor.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Makefile.config | 38 | ||||
-rw-r--r-- | tools/perf/Makefile.perf | 2 | ||||
-rw-r--r-- | tools/perf/arch/Build | 2 | ||||
-rw-r--r-- | tools/perf/pmu-events/Build | 4 | ||||
-rw-r--r-- | tools/perf/tests/Build | 2 | ||||
-rw-r--r-- | tools/perf/util/header.c | 2 |
6 files changed, 25 insertions, 25 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 8354d04b392f..1f4fbc9a3292 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config | |||
@@ -19,18 +19,18 @@ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) | |||
19 | 19 | ||
20 | include $(srctree)/tools/scripts/Makefile.arch | 20 | include $(srctree)/tools/scripts/Makefile.arch |
21 | 21 | ||
22 | $(call detected_var,ARCH) | 22 | $(call detected_var,SRCARCH) |
23 | 23 | ||
24 | NO_PERF_REGS := 1 | 24 | NO_PERF_REGS := 1 |
25 | 25 | ||
26 | # Additional ARCH settings for ppc | 26 | # Additional ARCH settings for ppc |
27 | ifeq ($(ARCH),powerpc) | 27 | ifeq ($(SRCARCH),powerpc) |
28 | NO_PERF_REGS := 0 | 28 | NO_PERF_REGS := 0 |
29 | LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 | 29 | LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 |
30 | endif | 30 | endif |
31 | 31 | ||
32 | # Additional ARCH settings for x86 | 32 | # Additional ARCH settings for x86 |
33 | ifeq ($(ARCH),x86) | 33 | ifeq ($(SRCARCH),x86) |
34 | $(call detected,CONFIG_X86) | 34 | $(call detected,CONFIG_X86) |
35 | ifeq (${IS_64_BIT}, 1) | 35 | ifeq (${IS_64_BIT}, 1) |
36 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated | 36 | CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated |
@@ -43,12 +43,12 @@ ifeq ($(ARCH),x86) | |||
43 | NO_PERF_REGS := 0 | 43 | NO_PERF_REGS := 0 |
44 | endif | 44 | endif |
45 | 45 | ||
46 | ifeq ($(ARCH),arm) | 46 | ifeq ($(SRCARCH),arm) |
47 | NO_PERF_REGS := 0 | 47 | NO_PERF_REGS := 0 |
48 | LIBUNWIND_LIBS = -lunwind -lunwind-arm | 48 | LIBUNWIND_LIBS = -lunwind -lunwind-arm |
49 | endif | 49 | endif |
50 | 50 | ||
51 | ifeq ($(ARCH),arm64) | 51 | ifeq ($(SRCARCH),arm64) |
52 | NO_PERF_REGS := 0 | 52 | NO_PERF_REGS := 0 |
53 | LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 | 53 | LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 |
54 | endif | 54 | endif |
@@ -61,7 +61,7 @@ endif | |||
61 | # Disable it on all other architectures in case libdw unwind | 61 | # Disable it on all other architectures in case libdw unwind |
62 | # support is detected in system. Add supported architectures | 62 | # support is detected in system. Add supported architectures |
63 | # to the check. | 63 | # to the check. |
64 | ifneq ($(ARCH),$(filter $(ARCH),x86 arm)) | 64 | ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm)) |
65 | NO_LIBDW_DWARF_UNWIND := 1 | 65 | NO_LIBDW_DWARF_UNWIND := 1 |
66 | endif | 66 | endif |
67 | 67 | ||
@@ -115,9 +115,9 @@ endif | |||
115 | FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS) | 115 | FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS) |
116 | FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf | 116 | FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf |
117 | 117 | ||
118 | FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi | 118 | FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi |
119 | # include ARCH specific config | 119 | # include ARCH specific config |
120 | -include $(src-perf)/arch/$(ARCH)/Makefile | 120 | -include $(src-perf)/arch/$(SRCARCH)/Makefile |
121 | 121 | ||
122 | ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET | 122 | ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET |
123 | CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET | 123 | CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET |
@@ -228,12 +228,12 @@ ifeq ($(DEBUG),0) | |||
228 | endif | 228 | endif |
229 | 229 | ||
230 | INC_FLAGS += -I$(src-perf)/util/include | 230 | INC_FLAGS += -I$(src-perf)/util/include |
231 | INC_FLAGS += -I$(src-perf)/arch/$(ARCH)/include | 231 | INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include |
232 | INC_FLAGS += -I$(srctree)/tools/include/uapi | 232 | INC_FLAGS += -I$(srctree)/tools/include/uapi |
233 | INC_FLAGS += -I$(srctree)/tools/include/ | 233 | INC_FLAGS += -I$(srctree)/tools/include/ |
234 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/uapi | 234 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi |
235 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/ | 235 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/ |
236 | INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/ | 236 | INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/ |
237 | 237 | ||
238 | # $(obj-perf) for generated common-cmds.h | 238 | # $(obj-perf) for generated common-cmds.h |
239 | # $(obj-perf)/util for generated bison/flex headers | 239 | # $(obj-perf)/util for generated bison/flex headers |
@@ -355,7 +355,7 @@ ifndef NO_LIBELF | |||
355 | 355 | ||
356 | ifndef NO_DWARF | 356 | ifndef NO_DWARF |
357 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 357 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
358 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 358 | msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled); |
359 | NO_DWARF := 1 | 359 | NO_DWARF := 1 |
360 | else | 360 | else |
361 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) | 361 | CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) |
@@ -380,7 +380,7 @@ ifndef NO_LIBELF | |||
380 | CFLAGS += -DHAVE_BPF_PROLOGUE | 380 | CFLAGS += -DHAVE_BPF_PROLOGUE |
381 | $(call detected,CONFIG_BPF_PROLOGUE) | 381 | $(call detected,CONFIG_BPF_PROLOGUE) |
382 | else | 382 | else |
383 | msg := $(warning BPF prologue is not supported by architecture $(ARCH), missing regs_query_register_offset()); | 383 | msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset()); |
384 | endif | 384 | endif |
385 | else | 385 | else |
386 | msg := $(warning DWARF support is off, BPF prologue is disabled); | 386 | msg := $(warning DWARF support is off, BPF prologue is disabled); |
@@ -406,7 +406,7 @@ ifdef PERF_HAVE_JITDUMP | |||
406 | endif | 406 | endif |
407 | endif | 407 | endif |
408 | 408 | ||
409 | ifeq ($(ARCH),powerpc) | 409 | ifeq ($(SRCARCH),powerpc) |
410 | ifndef NO_DWARF | 410 | ifndef NO_DWARF |
411 | CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX | 411 | CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX |
412 | endif | 412 | endif |
@@ -487,7 +487,7 @@ else | |||
487 | endif | 487 | endif |
488 | 488 | ||
489 | ifndef NO_LOCAL_LIBUNWIND | 489 | ifndef NO_LOCAL_LIBUNWIND |
490 | ifeq ($(ARCH),$(filter $(ARCH),arm arm64)) | 490 | ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64)) |
491 | $(call feature_check,libunwind-debug-frame) | 491 | $(call feature_check,libunwind-debug-frame) |
492 | ifneq ($(feature-libunwind-debug-frame), 1) | 492 | ifneq ($(feature-libunwind-debug-frame), 1) |
493 | msg := $(warning No debug_frame support found in libunwind); | 493 | msg := $(warning No debug_frame support found in libunwind); |
@@ -740,7 +740,7 @@ ifeq (${IS_64_BIT}, 1) | |||
740 | NO_PERF_READ_VDSO32 := 1 | 740 | NO_PERF_READ_VDSO32 := 1 |
741 | endif | 741 | endif |
742 | endif | 742 | endif |
743 | ifneq ($(ARCH), x86) | 743 | ifneq ($(SRCARCH), x86) |
744 | NO_PERF_READ_VDSOX32 := 1 | 744 | NO_PERF_READ_VDSOX32 := 1 |
745 | endif | 745 | endif |
746 | ifndef NO_PERF_READ_VDSOX32 | 746 | ifndef NO_PERF_READ_VDSOX32 |
@@ -769,7 +769,7 @@ ifdef LIBBABELTRACE | |||
769 | endif | 769 | endif |
770 | 770 | ||
771 | ifndef NO_AUXTRACE | 771 | ifndef NO_AUXTRACE |
772 | ifeq ($(ARCH),x86) | 772 | ifeq ($(SRCARCH),x86) |
773 | ifeq ($(feature-get_cpuid), 0) | 773 | ifeq ($(feature-get_cpuid), 0) |
774 | msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); | 774 | msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc); |
775 | NO_AUXTRACE := 1 | 775 | NO_AUXTRACE := 1 |
@@ -872,7 +872,7 @@ sysconfdir = $(prefix)/etc | |||
872 | ETC_PERFCONFIG = etc/perfconfig | 872 | ETC_PERFCONFIG = etc/perfconfig |
873 | endif | 873 | endif |
874 | ifndef lib | 874 | ifndef lib |
875 | ifeq ($(ARCH)$(IS_64_BIT), x861) | 875 | ifeq ($(SRCARCH)$(IS_64_BIT), x861) |
876 | lib = lib64 | 876 | lib = lib64 |
877 | else | 877 | else |
878 | lib = lib | 878 | lib = lib |
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 79fe31f20a17..5008f51a08a2 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -226,7 +226,7 @@ endif | |||
226 | 226 | ||
227 | ifeq ($(config),0) | 227 | ifeq ($(config),0) |
228 | include $(srctree)/tools/scripts/Makefile.arch | 228 | include $(srctree)/tools/scripts/Makefile.arch |
229 | -include arch/$(ARCH)/Makefile | 229 | -include arch/$(SRCARCH)/Makefile |
230 | endif | 230 | endif |
231 | 231 | ||
232 | # The FEATURE_DUMP_EXPORT holds location of the actual | 232 | # The FEATURE_DUMP_EXPORT holds location of the actual |
diff --git a/tools/perf/arch/Build b/tools/perf/arch/Build index 109eb75cf7de..d9b6af837c7d 100644 --- a/tools/perf/arch/Build +++ b/tools/perf/arch/Build | |||
@@ -1,2 +1,2 @@ | |||
1 | libperf-y += common.o | 1 | libperf-y += common.o |
2 | libperf-y += $(ARCH)/ | 2 | libperf-y += $(SRCARCH)/ |
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index 9213a1273697..999a4e878162 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build | |||
@@ -2,7 +2,7 @@ hostprogs := jevents | |||
2 | 2 | ||
3 | jevents-y += json.o jsmn.o jevents.o | 3 | jevents-y += json.o jsmn.o jevents.o |
4 | pmu-events-y += pmu-events.o | 4 | pmu-events-y += pmu-events.o |
5 | JDIR = pmu-events/arch/$(ARCH) | 5 | JDIR = pmu-events/arch/$(SRCARCH) |
6 | JSON = $(shell [ -d $(JDIR) ] && \ | 6 | JSON = $(shell [ -d $(JDIR) ] && \ |
7 | find $(JDIR) -name '*.json' -o -name 'mapfile.csv') | 7 | find $(JDIR) -name '*.json' -o -name 'mapfile.csv') |
8 | # | 8 | # |
@@ -10,4 +10,4 @@ JSON = $(shell [ -d $(JDIR) ] && \ | |||
10 | # directory and create tables in pmu-events.c. | 10 | # directory and create tables in pmu-events.c. |
11 | # | 11 | # |
12 | $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JEVENTS) | 12 | $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JEVENTS) |
13 | $(Q)$(call echo-cmd,gen)$(JEVENTS) $(ARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V) | 13 | $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V) |
diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index af58ebc243ef..84222bdb8689 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build | |||
@@ -75,7 +75,7 @@ $(OUTPUT)tests/llvm-src-relocation.c: tests/bpf-script-test-relocation.c tests/B | |||
75 | $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@ | 75 | $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@ |
76 | $(Q)echo ';' >> $@ | 76 | $(Q)echo ';' >> $@ |
77 | 77 | ||
78 | ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64 powerpc)) | 78 | ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc)) |
79 | perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o | 79 | perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o |
80 | endif | 80 | endif |
81 | 81 | ||
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 5cac8d5e009a..b5baff3007bb 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -841,7 +841,7 @@ static int write_group_desc(int fd, struct perf_header *h __maybe_unused, | |||
841 | 841 | ||
842 | /* | 842 | /* |
843 | * default get_cpuid(): nothing gets recorded | 843 | * default get_cpuid(): nothing gets recorded |
844 | * actual implementation must be in arch/$(ARCH)/util/header.c | 844 | * actual implementation must be in arch/$(SRCARCH)/util/header.c |
845 | */ | 845 | */ |
846 | int __weak get_cpuid(char *buffer __maybe_unused, size_t sz __maybe_unused) | 846 | int __weak get_cpuid(char *buffer __maybe_unused, size_t sz __maybe_unused) |
847 | { | 847 | { |