[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240524103144.4cd800c0@gandalf.local.home>
Date: Fri, 24 May 2024 10:31:44 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.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>, Sven Schnelle <svens@...ux.ibm.com>, Alexei
Starovoitov <ast@...nel.org>, Jiri Olsa <jolsa@...nel.org>, Arnaldo
Carvalho de Melo <acme@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Alan Maguire <alan.maguire@...cle.com>, Mark Rutland
<mark.rutland@....com>, Peter Zijlstra <peterz@...radead.org>, Thomas
Gleixner <tglx@...utronix.de>, Guo Ren <guoren@...nel.org>
Subject: Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in
the header
On Fri, 24 May 2024 10:37:54 +0900
Masami Hiramatsu (Google) <mhiramat@...nel.org> wrote:
> > >
> > > #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> > > struct ftrace_regs {
> > > + /*
> > > + * On the x86_64, the ftrace_regs saves;
> > > + * rax, rcx, rdx, rdi, rsi, r8, r9, rbp, rip and rsp.
> > > + * Also orig_ax is used for passing direct trampoline address.
> > > + * x86_32 doesn't support ftrace_regs.
> >
> > Should add a comment that if fregs->regs.cs is set, then all of the pt_regs
> > is valid.
>
> But what about rbx and r1*? Only regs->cs should be care for pt_regs?
> Or, did you mean "the ftrace_regs is valid"?
Yeah, on x86_64 ftrace_regs uses regs.cs to denote if it is valid or not:
static __always_inline struct pt_regs *
arch_ftrace_get_regs(struct ftrace_regs *fregs)
{
/* Only when FL_SAVE_REGS is set, cs will be non zero */
if (!fregs->regs.cs)
return NULL;
return &fregs->regs;
}
-- Steve
Powered by blists - more mailing lists