Unverified Commit b8dfd735 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!447 add perf loongarch support

Merge Pull Request from: @Hongchen_Zhang 
 
add architecture related perf support for loongarch 
 
Link:https://gitee.com/openeuler/kernel/pulls/447

 

Reviewed-by: default avatarGuo Dongtai <guodongtai@kylinos.cn>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 5d0a525a 4efd0de6
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -24,10 +24,17 @@ HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)

ifdef CONFIG_UNWINDER_ORC
# Additional ARCH settings for x86
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include

# Additional ARCH settings for loongarch
ifeq ($(ARCH),loongarch64)
ARCH := loongarch
endif

HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/$(ARCH)/include
HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
HOSTLDLIBS_sorttable = -lpthread
endif
+40 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_LOONGARCH_PERF_REGS_H
#define _ASM_LOONGARCH_PERF_REGS_H

enum perf_event_loongarch_regs {
	PERF_REG_LOONGARCH_PC,
	PERF_REG_LOONGARCH_R1,
	PERF_REG_LOONGARCH_R2,
	PERF_REG_LOONGARCH_R3,
	PERF_REG_LOONGARCH_R4,
	PERF_REG_LOONGARCH_R5,
	PERF_REG_LOONGARCH_R6,
	PERF_REG_LOONGARCH_R7,
	PERF_REG_LOONGARCH_R8,
	PERF_REG_LOONGARCH_R9,
	PERF_REG_LOONGARCH_R10,
	PERF_REG_LOONGARCH_R11,
	PERF_REG_LOONGARCH_R12,
	PERF_REG_LOONGARCH_R13,
	PERF_REG_LOONGARCH_R14,
	PERF_REG_LOONGARCH_R15,
	PERF_REG_LOONGARCH_R16,
	PERF_REG_LOONGARCH_R17,
	PERF_REG_LOONGARCH_R18,
	PERF_REG_LOONGARCH_R19,
	PERF_REG_LOONGARCH_R20,
	PERF_REG_LOONGARCH_R21,
	PERF_REG_LOONGARCH_R22,
	PERF_REG_LOONGARCH_R23,
	PERF_REG_LOONGARCH_R24,
	PERF_REG_LOONGARCH_R25,
	PERF_REG_LOONGARCH_R26,
	PERF_REG_LOONGARCH_R27,
	PERF_REG_LOONGARCH_R28,
	PERF_REG_LOONGARCH_R29,
	PERF_REG_LOONGARCH_R30,
	PERF_REG_LOONGARCH_R31,
	PERF_REG_LOONGARCH_MAX = PERF_REG_LOONGARCH_R31 + 1,
};
#endif /* _ASM_LOONGARCH_PERF_REGS_H */
+22 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Copyright (C) 2020-2021 Loongson Technology Corporation Limited
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_CLONE3

#include <asm-generic/unistd.h>
+7 −0
Original line number Diff line number Diff line
@@ -74,6 +74,13 @@ ifeq ($(SRCARCH),arm64)
  LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
endif

ifeq ($(SRCARCH),loongarch)
  NO_PERF_REGS := 0
  CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated
  CFLAGS += -I$(OUTPUT)../arch/loongarch/include/uapi
  LIBUNWIND_LIBS = -lunwind -lunwind-loongarch
endif

ifeq ($(SRCARCH),riscv)
  NO_PERF_REGS := 0
endif
+1 −0
Original line number Diff line number Diff line
perf-y += util/
Loading