Commit d56deee2 authored by Mao Minkai's avatar Mao Minkai Committed by guzitao
Browse files

perf: fix sw64 support

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8YRCP



--------------------------------

Modify generic Build, Makefiles and routines for SW64 support.

Signed-off-by: default avatarMao Minkai <maominkai@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent a773a53e
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -94,6 +94,12 @@ ifeq ($(SRCARCH),csky)
  NO_PERF_REGS := 0
endif

ifeq ($(SRCARCH),sw_64)
  NO_PERF_REGS := 0
  CFLAGS += -mieee
  LIBUNWIND_LIBS = -lunwind -lunwind-sw_64
endif

ifeq ($(ARCH),s390)
  NO_PERF_REGS := 0
  CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
@@ -640,6 +646,13 @@ ifndef NO_LIBUNWIND
      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
    endif
  endif
  ifeq ($(feature-libunwind-sw_64), 1)
    $(call detected,CONFIG_LIBUNWIND_SW64)
    CFLAGS += -DHAVE_LIBUNWIND_SW_64_SUPPORT
    LDFLAGS += -lunwind-sw_64
    EXTLIBS_LIBUNWIND += -lunwind-sw_64
    have_libunwind = 1
  endif

  ifneq ($(feature-libunwind), 1)
    msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ perf-y += sigtrap.o
perf-y += event_groups.o
perf-y += symbols.o

ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc))
ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc sw_64))
perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
endif

+1 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
perf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
perf-$(CONFIG_LIBUNWIND_X86)      += libunwind/x86_32.o
perf-$(CONFIG_LIBUNWIND_AARCH64)  += libunwind/arm64.o
perf-$(CONFIG_LIBUNWIND_SW64)     += libunwind/sw64.o

ifeq ($(CONFIG_LIBTRACEEVENT),y)
  perf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
+3 −0
Original line number Diff line number Diff line
@@ -180,6 +180,9 @@ static struct arch architectures[] = {
			.comment_char = '#',
		},
	},
	{
		.name = "sw_64",
	},
	{
		.name = "x86",
		.init = x86__annotate_init,
+2 −0
Original line number Diff line number Diff line
@@ -422,6 +422,8 @@ static const char *normalize_arch(char *arch)
		return "arm64";
	if (!strncmp(arch, "arm", 3) || !strcmp(arch, "sa110"))
		return "arm";
	if (!strncmp(arch, "sw_64", 5))
		return "sw_64";
	if (!strncmp(arch, "s390", 4))
		return "s390";
	if (!strncmp(arch, "parisc", 6))
Loading