All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][V3] arm64: perf: Get the wrong PC value in REGS_ABI_32 mode
@ 2020-05-11  2:52 Jiping Ma
  2020-05-26  2:46   ` Jiping Ma
  2020-05-26 10:26   ` Mark Rutland
  0 siblings, 2 replies; 29+ messages in thread
From: Jiping Ma @ 2020-05-11  2:52 UTC (permalink / raw)
  To: will.deacon, paul.gortmaker, mark.rutland, catalin.marinas,
	jiping.ma2, bruce.ashfield, yue.tao
  Cc: linux-arm-kernel, linux-kernel, zhe.he

Modified the patch subject and the change description.

PC value is get from regs[15] in REGS_ABI_32 mode, but correct PC
is regs->pc(regs[PERF_REG_ARM64_PC]) in arm64 kernel, which caused
that perf can not parser the backtrace of app with dwarf mode in the 
32bit system and 64bit kernel.

Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
 arch/arm64/kernel/perf_regs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 0bbac61..0ef2880 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -32,6 +32,10 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
 	if ((u32)idx == PERF_REG_ARM64_PC)
 		return regs->pc;
 
+	if (perf_reg_abi(current) == PERF_SAMPLE_REGS_ABI_32
+		&& idx == 15)
+		return regs->pc;
+
 	return regs->regs[idx];
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2020-06-25 12:56 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-11  2:52 [PATCH][V3] arm64: perf: Get the wrong PC value in REGS_ABI_32 mode Jiping Ma
2020-05-26  2:46 ` Jiping Ma
2020-05-26  2:46   ` Jiping Ma
2020-05-26 10:26 ` Mark Rutland
2020-05-26 10:26   ` Mark Rutland
2020-05-26 19:54   ` Will Deacon
2020-05-26 19:54     ` Will Deacon
2020-05-27  1:30     ` Jiping Ma
2020-05-27  1:30       ` Jiping Ma
2020-05-27 15:03     ` Mark Rutland
2020-05-27 15:03       ` Mark Rutland
2020-05-27  1:33   ` Jiping Ma
2020-05-27  1:33     ` Jiping Ma
2020-05-27 15:19     ` Mark Rutland
2020-05-27 15:19       ` Mark Rutland
2020-05-28  1:06       ` Jiping Ma
2020-05-28  1:06         ` Jiping Ma
2020-05-28  7:54         ` Will Deacon
2020-05-28  7:54           ` Will Deacon
2020-05-29  5:57           ` Jiping Ma
2020-05-29  5:57             ` Jiping Ma
2020-06-18 13:03           ` Mark Rutland
2020-06-18 13:03             ` Mark Rutland
2020-06-23 17:19             ` Will Deacon
2020-06-23 17:19               ` Will Deacon
2020-06-23 17:44               ` Will Deacon
2020-06-23 17:44                 ` Will Deacon
2020-06-25 12:54                 ` Mark Rutland
2020-06-25 12:54                   ` Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.