ftrace: Fix address for jmp mode in t_show()

The address from ftrace_find_rec_direct() is printed directly in t_show().
This can mislead symbol offsets if it has the "jmp" bit in the last bit.

Fix this by printing the address that returned by ftrace_jmp_get().

Link: https://patch.msgid.link/20251217030053.80343-1-dongml2@chinatelecom.cn
Fixes: 25e4e3565d ("ftrace: Introduce FTRACE_OPS_FL_JMP")
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Menglong Dong
2025-12-17 11:00:53 +08:00
committed by Steven Rostedt (Google)
parent 74bf97e9a8
commit 39263f986d

View File

@@ -4518,8 +4518,11 @@ static int t_show(struct seq_file *m, void *v)
unsigned long direct;
direct = ftrace_find_rec_direct(rec->ip);
if (direct)
seq_printf(m, "\n\tdirect-->%pS", (void *)direct);
if (direct) {
seq_printf(m, "\n\tdirect%s-->%pS",
ftrace_is_jmp(direct) ? "(jmp)" : "",
(void *)ftrace_jmp_get(direct));
}
}
}