Skip to content

Commit a6cf5f3

Browse files
Jiri Olsaacmel
authored andcommitted
perf tools: Move arch setup into seprate Makefile
I need to use arch related setup in the tests/make, so moving arch setup into Makefile.arch. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1388759553-12974-1-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 41cde47 commit a6cf5f3

2 files changed

Lines changed: 40 additions & 34 deletions

File tree

‎tools/perf/config/Makefile‎

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
uname_M := $(shell uname -m 2>/dev/null || echo not)
21

3-
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
4-
-e s/arm.*/arm/ -e s/sa110/arm/ \
5-
-e s/s390x/s390/ -e s/parisc64/parisc/ \
6-
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
7-
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
8-
NO_PERF_REGS := 1
9-
CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
2+
ifeq ($(src-perf),)
3+
src-perf := $(srctree)/tools/perf
4+
endif
105

11-
# Additional ARCH settings for x86
12-
ifeq ($(ARCH),i386)
13-
override ARCH := x86
14-
NO_PERF_REGS := 0
15-
LIBUNWIND_LIBS = -lunwind -lunwind-x86
6+
ifeq ($(obj-perf),)
7+
obj-perf := $(OUTPUT)
168
endif
179

18-
ifeq ($(ARCH),x86_64)
19-
override ARCH := x86
20-
IS_X86_64 := 0
21-
ifeq (, $(findstring m32,$(CFLAGS)))
22-
IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
23-
endif
10+
ifneq ($(obj-perf),)
11+
obj-perf := $(abspath $(obj-perf))/
12+
endif
13+
14+
LIB_INCLUDE := $(srctree)/tools/lib/
15+
CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
16+
17+
include $(src-perf)/config/Makefile.arch
18+
19+
NO_PERF_REGS := 1
20+
21+
# Additional ARCH settings for x86
22+
ifeq ($(ARCH),x86)
2423
ifeq (${IS_X86_64}, 1)
25-
RAW_ARCH := x86_64
2624
CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
2725
ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
2826
LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
@@ -64,20 +62,6 @@ ifeq ($(NO_PERF_REGS),0)
6462
CFLAGS += -DHAVE_PERF_REGS_SUPPORT
6563
endif
6664

67-
ifeq ($(src-perf),)
68-
src-perf := $(srctree)/tools/perf
69-
endif
70-
71-
ifeq ($(obj-perf),)
72-
obj-perf := $(OUTPUT)
73-
endif
74-
75-
ifneq ($(obj-perf),)
76-
obj-perf := $(abspath $(obj-perf))/
77-
endif
78-
79-
LIB_INCLUDE := $(srctree)/tools/lib/
80-
8165
# include ARCH specific config
8266
-include $(src-perf)/arch/$(ARCH)/Makefile
8367

‎tools/perf/config/Makefile.arch‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
uname_M := $(shell uname -m 2>/dev/null || echo not)
3+
4+
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
5+
-e s/arm.*/arm/ -e s/sa110/arm/ \
6+
-e s/s390x/s390/ -e s/parisc64/parisc/ \
7+
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
8+
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
9+
10+
# Additional ARCH settings for x86
11+
ifeq ($(ARCH),i386)
12+
override ARCH := x86
13+
endif
14+
15+
ifeq ($(ARCH),x86_64)
16+
override ARCH := x86
17+
IS_X86_64 := 0
18+
ifeq (, $(findstring m32,$(CFLAGS)))
19+
IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
20+
RAW_ARCH := x86_64
21+
endif
22+
endif

0 commit comments

Comments
 (0)