summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/ftrace.c
diff options
context:
space:
mode:
authorTony Lu2015-03-27 19:46:38 +0100
committerChris Metcalf2015-04-17 20:01:38 +0200
commit437d3e124d25daaa671bfecfd4015ecd2503a955 (patch)
treeddc6e9491b9a14a09c6476d0543e9f4896dfd77d /arch/tile/kernel/ftrace.c
parenttile: map data region shadow of kernel as R/W (diff)
downloadkernel-qcow2-linux-437d3e124d25daaa671bfecfd4015ecd2503a955.tar.gz
kernel-qcow2-linux-437d3e124d25daaa671bfecfd4015ecd2503a955.tar.xz
kernel-qcow2-linux-437d3e124d25daaa671bfecfd4015ecd2503a955.zip
tile: ftrace: fix function_graph tracer issues
- Add support for ARCH_SUPPORTS_FTRACE_OPS - Replace the instruction in ftrace_call with the bundle {move r10, lr; jal ftrace_stub}, so that the lr contains the right value after returning from ftrace_stub. An alternative fix might be to leave the instruction in ftrace_call alone when it is being updated with ftrace_stub. Signed-off-by: Tony Lu <zlu@ezchip.com> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Diffstat (limited to 'arch/tile/kernel/ftrace.c')
-rw-r--r--arch/tile/kernel/ftrace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/tile/kernel/ftrace.c b/arch/tile/kernel/ftrace.c
index 8d52d83cc516..0c0996175b1e 100644
--- a/arch/tile/kernel/ftrace.c
+++ b/arch/tile/kernel/ftrace.c
@@ -74,7 +74,11 @@ static unsigned long ftrace_gen_branch(unsigned long pc, unsigned long addr,
create_JumpOff_X1(pcrel_by_instr);
}
- if (addr == FTRACE_ADDR) {
+ /*
+ * Also put { move r10, lr; jal ftrace_stub } in a bundle, which
+ * is used to replace the instruction in address ftrace_call.
+ */
+ if (addr == FTRACE_ADDR || addr == (unsigned long)ftrace_stub) {
/* opcode: or r10, lr, zero */
opcode_x0 =
create_Dest_X0(10) |