From: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
To: linux-kernel@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Miroslav Benes <mbenes@suse.cz>,
Masami Hiramatsu <mhiramat@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/3 v5] ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs
Date: Thu, 12 Nov 2020 22:38:53 +0530 [thread overview]
Message-ID: <1605200348.x55f7x9h4h.naveen@linux.ibm.com> (raw)
In-Reply-To: <20201112011815.466562067@goodmis.org>
Hi Steven,
Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> In preparation to have arguments of a function passed to callbacks attached
> to functions as default, change the default callback prototype to receive a
> struct ftrace_regs as the forth parameter instead of a pt_regs.
>
> For callbacks that set the FL_SAVE_REGS flag in their ftrace_ops flags, they
> will now need to get the pt_regs via a ftrace_get_regs() helper call. If
> this is called by a callback that their ftrace_ops did not have a
> FL_SAVE_REGS flag set, it that helper function will return NULL.
>
> This will allow the ftrace_regs to hold enough just to get the parameters
> and stack pointer, but without the worry that callbacks may have a pt_regs
> that is not completely filled.
>
> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> arch/x86/kernel/kprobes/ftrace.c | 3 ++-
> fs/pstore/ftrace.c | 2 +-
> include/linux/ftrace.h | 16 ++++++++++++++--
> include/linux/kprobes.h | 2 +-
> kernel/livepatch/patch.c | 3 ++-
> kernel/trace/ftrace.c | 27 +++++++++++++++------------
> kernel/trace/trace_event_perf.c | 2 +-
> kernel/trace/trace_events.c | 2 +-
> kernel/trace/trace_functions.c | 9 ++++-----
> kernel/trace/trace_irqsoff.c | 2 +-
> kernel/trace/trace_sched_wakeup.c | 2 +-
> kernel/trace/trace_selftest.c | 20 +++++++++++---------
> kernel/trace/trace_stack.c | 2 +-
> 13 files changed, 55 insertions(+), 37 deletions(-)
>
<snip>
> diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
> index 629abaf25681..be73350955e4 100644
> --- a/include/linux/kprobes.h
> +++ b/include/linux/kprobes.h
> @@ -345,7 +345,7 @@ static inline void wait_for_kprobe_optimizer(void)
> { }
> #endif /* CONFIG_OPTPROBES */
> #ifdef CONFIG_KPROBES_ON_FTRACE
> extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
> - struct ftrace_ops *ops, struct pt_regs *regs);
> + struct ftrace_ops *ops, struct ftrace_regs *fregs);
This breaks the build on non-x86 architectures that support
KPROBES_ON_FTRACE.
- Naveen
next prev parent reply other threads:[~2020-11-12 17:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 1:15 [PATCH 0/3 v5] ftrace: Add access to function arguments for all callbacks Steven Rostedt
2020-11-12 1:15 ` [PATCH 1/3 v5] ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs Steven Rostedt
2020-11-12 17:08 ` Naveen N. Rao [this message]
2020-11-12 17:21 ` Steven Rostedt
2020-11-12 1:15 ` [PATCH 2/3 v5] ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default Steven Rostedt
2020-11-12 1:15 ` [PATCH 3/3 v5] livepatch: Use the default ftrace_ops instead of REGS when ARGS is available Steven Rostedt
2020-11-12 8:21 ` Peter Zijlstra
2020-11-12 11:39 ` Peter Zijlstra
2020-11-12 14:59 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1605200348.x55f7x9h4h.naveen@linux.ibm.com \
--to=naveen.n.rao@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome