[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Mar 2022 09:34:13 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
alexei.starovoitov@...il.com, alyssa.milburn@...el.com,
andrew.cooper3@...rix.com, hjl.tools@...il.com,
joao@...rdrivepizza.com, jpoimboe@...hat.com,
keescook@...omium.org, linux-kernel@...r.kernel.org,
mark.rutland@....com, mbenes@...e.cz,
Masami Hiramatsu <mhiramat@...nel.org>,
ndesaulniers@...gle.com, samitolvanen@...gle.com, x86@...nel.org
Subject: Re: [PATCH v2 12/39] x86/ibt,ftrace: Search for __fentry__ location
On Thu, 3 Mar 2022 14:04:52 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> > @@ -1596,7 +1596,7 @@ static int check_ftrace_location(struct kprobe *p)
> > {
> > unsigned long ftrace_addr;
> >
> > - ftrace_addr = ftrace_location((unsigned long)p->addr);
> > + ftrace_addr = ftrace_location_range((unsigned long)p->addr, (unsigned long)p->addr);
>
> Yes, although perhaps a new helper. I'll go ponder during lunch.
Is there more places to add that to make it worth creating a helper?
If not, I would just keep using the ftrace_location_range().
If there is to be a helper function, then we should not have touched
ftrace_location() in the first place, and instead created a new function
that does the offset check.
Because thinking about this more, ftrace_location() is suppose to act just
like ftrace_location_range() and now it does not.
I rather keep ftrace_location() the same as ftrace_location_range() if
there's going to be another API. Maybe create a function ftrace_addr() that
does the new ftrace_location() that you have, and leave ftrace_location()
as is?
This is actually what I suggested in the beginning.
-- Steve
Powered by blists - more mailing lists