summaryrefslogtreecommitdiff
path: root/tools/perf/arch/arm/util
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-09-26 12:36:36 +0100
committerWill Deacon <will.deacon@arm.com>2013-09-30 16:41:55 +0100
commit7495f3742dda97612a77d92fa62f85cb7591ab14 (patch)
treeb9208a9e15ed268b6e96394493a09793b7fc1f0f /tools/perf/arch/arm/util
parent49863894db3ed7bd41541b1c17733273966cea71 (diff)
downloadlinux-7495f3742dda97612a77d92fa62f85cb7591ab14.tar.gz
ARM: perf: wire up perf_regs and unwind support for ARM
This patch hooks in the perf_regs and libunwind code for ARM. Cc: Jean Pihet <jean.pihet@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'tools/perf/arch/arm/util')
-rw-r--r--tools/perf/arch/arm/util/unwind.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/perf/arch/arm/util/unwind.c b/tools/perf/arch/arm/util/unwind.c
new file mode 100644
index 000000000000..da3dc950550c
--- /dev/null
+++ b/tools/perf/arch/arm/util/unwind.c
@@ -0,0 +1,48 @@
+
+#include <errno.h>
+#include <libunwind.h>
+#include "perf_regs.h"
+#include "../../util/unwind.h"
+
+int unwind__arch_reg_id(int regnum)
+{
+ switch (regnum) {
+ case UNW_ARM_R0:
+ return PERF_REG_ARM_R0;
+ case UNW_ARM_R1:
+ return PERF_REG_ARM_R1;
+ case UNW_ARM_R2:
+ return PERF_REG_ARM_R2;
+ case UNW_ARM_R3:
+ return PERF_REG_ARM_R3;
+ case UNW_ARM_R4:
+ return PERF_REG_ARM_R4;
+ case UNW_ARM_R5:
+ return PERF_REG_ARM_R5;
+ case UNW_ARM_R6:
+ return PERF_REG_ARM_R6;
+ case UNW_ARM_R7:
+ return PERF_REG_ARM_R7;
+ case UNW_ARM_R8:
+ return PERF_REG_ARM_R8;
+ case UNW_ARM_R9:
+ return PERF_REG_ARM_R9;
+ case UNW_ARM_R10:
+ return PERF_REG_ARM_R10;
+ case UNW_ARM_R11:
+ return PERF_REG_ARM_FP;
+ case UNW_ARM_R12:
+ return PERF_REG_ARM_IP;
+ case UNW_ARM_R13:
+ return PERF_REG_ARM_SP;
+ case UNW_ARM_R14:
+ return PERF_REG_ARM_LR;
+ case UNW_ARM_R15:
+ return PERF_REG_ARM_PC;
+ default:
+ pr_err("unwind: invalid reg id %d\n", regnum);
+ return -EINVAL;
+ }
+
+ return -EINVAL;
+}