Thread (11 messages) 11 messages, 7 authors, 2021-02-09

Re: [GIT PULL] x86/urgent for v5.11-rc7

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2021-02-08 18:33:23
Also in: lkml

On Mon, 8 Feb 2021 16:47:05 +0100
Peter Zijlstra [off-list ref] wrote:
quoted
/*
 * Convert a function address into the appropriate ftrace location.
 *
 * Usually this is just the address of the function, but on some architectures
 * it's more complicated so allow them to provide a custom behaviour.
 */
#ifndef klp_get_ftrace_location
static unsigned long klp_get_ftrace_location(unsigned long faddr)
{
	return faddr;
}
#endif  
I suppose the trivial fix is to see if it points to endbr64 and if so,
increment the addr by the length of that.
I thought of that too. But one thing that may be possible, is to use
kallsym. I believe you can get the range of a function (start and end of
the function) from kallsyms. Then ask ftrace for the addr in that range
(there should only be one).

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help