tracing: Fix function name for trampoline

The issue that unrelated function name is shown on stack trace like
following even though it should be trampoline code address is caused by
the creation of trampoline code in the area where .init.text section
of module was freed after module is loaded.

bash-1344    [002] .....    43.644608: <stack trace>
=> (MODULE INIT FUNCTION)
=> vfs_write
=> ksys_write
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe

To resolve this, when function address of stack trace entry is in
trampoline, output without looking up symbol name.

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20241021071454.34610-2-tatsuya.s2862@gmail.com
Signed-off-by: Tatsuya S <tatsuya.s2862@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Tatsuya S
2024-10-21 07:14:53 +00:00
committed by Steven Rostedt (Google)
parent 60b1f578b5
commit 6ce5a6f0a0
3 changed files with 36 additions and 8 deletions

View File

@@ -2172,4 +2172,11 @@ static inline int rv_init_interface(void)
}
#endif
/*
* This is used only to distinguish
* function address from trampoline code.
* So this value has no meaning.
*/
#define FTRACE_TRAMPOLINE_MARKER ((unsigned long) INT_MAX)
#endif /* _LINUX_KERNEL_TRACE_H */