lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 12/39] x86/ibt,ftrace: Search for __fentry__ location
On Fri, 25 Feb 2022 00:55:20 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> > unsigned long ftrace_location(unsigned long ip)
> > {
> > - return ftrace_location_range(ip, ip);
> > + struct dyn_ftrace *rec;
> > + unsigned long offset;
> > + unsigned long size;
> > +
> > + rec = lookup_rec(ip, ip);
> > + if (!rec) {
> > + if (!kallsyms_lookup_size_offset(ip, &size, &offset))
> > + goto out;
> > +
> > + if (!offset)
>
> Isn't this 'if (offset)' ?

No, the point to only look for the fentry location if the ip passed in
points to the start of the function. IOW, +0 offset.

-- Steve


>
> > + rec = lookup_rec(ip - offset, (ip - offset) + size);
> > + }
> > +
> > + if (rec)
> > + return rec->ip;
> > +
> > +out:
> > + return 0;

\
 
 \ /
  Last update: 2022-02-24 17:11    [W:0.241 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site