[LOCAL] arm64: perf: Report arm pc registers for compat perf 26/218026/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Dec 2019 00:57:56 +0000 (09:57 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 19 Nov 2019 02:17:01 +0000 (11:17 +0900)
If perf is built as arm 32-bit, it only reads 15 registers as arm
32-bit register map and this breaks dwarf call-chain in compat
perf because pc register information is not filled.
Report arm pc registers for 32-bit compat perf.

Without this, arm 32-bit perf dwarf call-graph shows below
verbose message:
  unwind: reg 15, val 0
  unwind: reg 13, val ffbc6360
  unwind: no map for 0

Posted to mainline[1] but never merged.

[1]: https://patchwork.kernel.org/patch/11238463/
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I84edf124ba4443d70654242bca6f23e9242546cb

arch/arm64/kernel/perf_regs.c

index 6762ad705587fa34fff0281546273a6930ddbcbf..fd855f7272136c5bd69a250d4dd137eed4e54a4c 100644 (file)
@@ -22,6 +22,8 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
                        return regs->compat_sp;
                if ((u32)idx == PERF_REG_ARM64_LR)
                        return regs->compat_lr;
+               if ((u32)idx == 15) /* PERF_REG_ARM_PC */
+                       return regs->pc;
        }
 
        if ((u32)idx == PERF_REG_ARM64_SP)