Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ee0d7fd authored by Jean Pihet's avatar Jean Pihet Committed by Catalin Marinas
Browse files

ARM64: perf: add support for perf registers API



This patch implements the functions required for the perf registers API,
allowing the perf tool to interface kernel register dumps with libunwind
in order to provide userspace backtracing.
Compat mode is also supported.

Only the general purpose user space registers are exported, i.e.:
 PERF_REG_ARM_X0,
 ...
 PERF_REG_ARM_X28,
 PERF_REG_ARM_FP,
 PERF_REG_ARM_LR,
 PERF_REG_ARM_SP,
 PERF_REG_ARM_PC
and not the PERF_REG_ARM_V* registers.

Signed-off-by: default avatarJean Pihet <jean.pihet@linaro.org>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 87366d8c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ config ARM64
	select HAVE_MEMBLOCK
	select HAVE_PATA_PLATFORM
	select HAVE_PERF_EVENTS
	select HAVE_PERF_REGS
	select HAVE_PERF_USER_STACK_DUMP
	select IRQ_DOMAIN
	select MODULES_USE_ELF_RELA
	select NO_BOOTMEM
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@

/* Architecturally defined mapping between AArch32 and AArch64 registers */
#define compat_usr(x)	regs[(x)]
#define compat_fp	regs[11]
#define compat_sp	regs[13]
#define compat_lr	regs[14]
#define compat_sp_hyp	regs[15]
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ header-y += byteorder.h
header-y += fcntl.h
header-y += hwcap.h
header-y += kvm_para.h
header-y += perf_regs.h
header-y += param.h
header-y += ptrace.h
header-y += setup.h
+40 −0
Original line number Diff line number Diff line
#ifndef _ASM_ARM64_PERF_REGS_H
#define _ASM_ARM64_PERF_REGS_H

enum perf_event_arm_regs {
	PERF_REG_ARM64_X0,
	PERF_REG_ARM64_X1,
	PERF_REG_ARM64_X2,
	PERF_REG_ARM64_X3,
	PERF_REG_ARM64_X4,
	PERF_REG_ARM64_X5,
	PERF_REG_ARM64_X6,
	PERF_REG_ARM64_X7,
	PERF_REG_ARM64_X8,
	PERF_REG_ARM64_X9,
	PERF_REG_ARM64_X10,
	PERF_REG_ARM64_X11,
	PERF_REG_ARM64_X12,
	PERF_REG_ARM64_X13,
	PERF_REG_ARM64_X14,
	PERF_REG_ARM64_X15,
	PERF_REG_ARM64_X16,
	PERF_REG_ARM64_X17,
	PERF_REG_ARM64_X18,
	PERF_REG_ARM64_X19,
	PERF_REG_ARM64_X20,
	PERF_REG_ARM64_X21,
	PERF_REG_ARM64_X22,
	PERF_REG_ARM64_X23,
	PERF_REG_ARM64_X24,
	PERF_REG_ARM64_X25,
	PERF_REG_ARM64_X26,
	PERF_REG_ARM64_X27,
	PERF_REG_ARM64_X28,
	PERF_REG_ARM64_X29,
	PERF_REG_ARM64_LR,
	PERF_REG_ARM64_SP,
	PERF_REG_ARM64_PC,
	PERF_REG_ARM64_MAX,
};
#endif /* _ASM_ARM64_PERF_REGS_H */
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o \
					   sys_compat.o
arm64-obj-$(CONFIG_MODULES)		+= arm64ksyms.o module.o
arm64-obj-$(CONFIG_SMP)			+= smp.o smp_spin_table.o topology.o
arm64-obj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
arm64-obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o
arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o
arm64-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
Loading