[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241001193234.2acb6147@gandalf.local.home>
Date: Tue, 1 Oct 2024 19:32:34 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Will Deacon <will@...nel.org>, Catalin Marinas
<catalin.marinas@....com>, linux-arm-kernel@...ts.infradead.org, Florent
Revest <revest@...omium.org>, linux-trace-kernel@...r.kernel.org, LKML
<linux-kernel@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>, Jiri
Olsa <jolsa@...nel.org>, Arnaldo Carvalho de Melo <acme@...nel.org>, Daniel
Borkmann <daniel@...earbox.net>, Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH v14 04/19] function_graph: Replace fgraph_ret_regs with
ftrace_regs
On Wed, 2 Oct 2024 08:10:37 +0900
Masami Hiramatsu (Google) <mhiramat@...nel.org> wrote:
> >
> > I may add some compiler hacks to enforce this. Something like:
> >
> > struct ftrace_regs {
> > void *nothing_to_see_here;
> > };
>
> Yeah, OK. But sizeof(fregs) may be changed. (Shouldn't we do too?)
Honestly, I don't think anything should be doing a sizeof(struct ftrace_regs)
Heck, perhaps we should make it totally zero!
struct ftrace_regs {
long nothing_here[];
};
If someone needs to allocate, then we could provide a:
ftrace_regs_size()
helper function.
>
> >
> > And then change the arch code to be something like:
> >
> > // in arch/arm64/include/asm/ftrace.h:
> >
> > struct arch_ftrace_regs {
> > /* x0 - x8 */
> > unsigned long regs[9];
> >
> > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
> > unsigned long direct_tramp;
> > #else
> > unsigned long __unused;
> > #endif
> >
> > unsigned long fp;
> > unsigned long lr;
> >
> > unsigned long sp;
> > unsigned long pc;
> > };
>
> And if it is pt_regs compatible,
>
> #define arch_ftrace_regs pt_regs
>
> ?
>
Only if it is fully pt_regs compatible.
-- Steve
Powered by blists - more mailing lists