[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20241209153651.c622af218b5d4b2c2da76158@kernel.org>
Date: Mon, 9 Dec 2024 15:36:51 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>, Florent Revest
<revest@...omium.org>, linux-trace-kernel@...r.kernel.org, LKML
<linux-kernel@...r.kernel.org>, Martin KaFai Lau <martin.lau@...ux.dev>,
bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>, Jiri Olsa
<jolsa@...nel.org>, Alan Maguire <alan.maguire@...cle.com>, Mark Rutland
<mark.rutland@....com>, linux-arch@...r.kernel.org
Subject: Re: [PATCH v20 00/19] tracing: fprobe: function_graph:
Multi-function graph and fprobe on fgraph
On Sat, 7 Dec 2024 09:47:10 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Sat, 7 Dec 2024 15:51:36 +0900
> Masami Hiramatsu (Google) <mhiramat@...nel.org> wrote:
>
> > This checks the handler is called with preempt off.
> >
> > On x86_64, the ftrace_graph_func calls function_graph_enter_regs() with
> > ftrace_test_recursion_trylock() as below;
> >
> > void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
> > struct ftrace_ops *op, struct ftrace_regs *fregs)
> > {
> > struct pt_regs *regs = &arch_ftrace_regs(fregs)->regs;
> > unsigned long *stack = (unsigned long *)kernel_stack_pointer(regs);
> > unsigned long return_hooker = (unsigned long)&return_to_handler;
> > unsigned long *parent = (unsigned long *)stack;
> > int bit;
> >
> > if (unlikely(skip_ftrace_return()))
> > return;
> >
> > bit = ftrace_test_recursion_trylock(ip, *parent);
> > if (bit < 0)
> > return;
> >
> > if (!function_graph_enter_regs(*parent, ip, 0, parent, fregs))
> > *parent = return_hooker;
> >
> > ftrace_test_recursion_unlock(bit);
> > }
> >
> > However, arm64 version does not;
>
> Hmm, I think we can move that recursion check out of the arch/x86 code
> and into ftrace_graph_enter_regs().
OK, that's reasonable.
Thanks,
>
> -- Steve
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists