From: Enze Li <lienze@kylinos.cn>
To: Youling Tang <tangyouling@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
WANG Xuerui <kernel@xen0n.name>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn,
Qing Zhang <zhangqing@loongson.cn>
Subject: Re: [PATCH v2 5/5] LoongArch: Abstract DYNAMIC_FTRACE_WITH_ARGS accesses
Date: Thu, 27 Apr 2023 14:16:06 +0800 [thread overview]
Message-ID: <87h6t17sux.fsf@kylinos.cn> (raw)
In-Reply-To: <1682561552-32324-6-git-send-email-tangyouling@loongson.cn> (Youling Tang's message of "Thu, 27 Apr 2023 10:12:32 +0800")
On Thu, Apr 27 2023 at 10:12:32 AM +0800, Youling Tang wrote:
> From: Qing Zhang <zhangqing@loongson.cn>
>
> 1. Adds new ftrace_regs_{get,set}_*() helpers which can be used to manipulate
> ftrace_regs. When CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y, these can always
> be used on any ftrace_regs, and when CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=n
> these can be used when regs are available. A new ftrace_regs_has_args(fregs)
> helper is added which code can use to check when these are usable.
>
> 2. Prepare ftrace_regs_set_instruction_pointer support in advance.
>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
> arch/loongarch/include/asm/ftrace.h | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/arch/loongarch/include/asm/ftrace.h b/arch/loongarch/include/asm/ftrace.h
> index f789e680f633..30ee01243416 100644
> --- a/arch/loongarch/include/asm/ftrace.h
> +++ b/arch/loongarch/include/asm/ftrace.h
> @@ -54,6 +54,31 @@ static __always_inline struct pt_regs *arch_ftrace_get_regs(struct ftrace_regs *
> return &fregs->regs;
> }
>
> +static __always_inline void
> +ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs,
> + unsigned long ip)
> +{
> + regs_set_return_value(&fregs->regs, ip);
> +}
> +
> +static __always_inline unsigned long
> +ftrace_regs_get_instruction_pointer(struct ftrace_regs *fregs)
> +{
> + return instruction_pointer(&fregs->regs);
> +}
> +
> +#define ftrace_regs_get_argument(fregs, n) \
> + regs_get_kernel_argument(&(fregs)->regs, n)
> +#define ftrace_regs_get_stack_pointer(fregs) \
> + kernel_stack_pointer(&(fregs)->regs)
> +#define ftrace_regs_return_value(fregs) \
> + regs_return_value(&(fregs)->regs)
> +#define ftrace_regs_set_return_value(fregs, ret) \
Hi Youling,
> + regs_set_return_value(&(fregs)->regs, ret)
^^^^^^^^^^^^^^^^^^^^^^^^
I can not find the implementation of this function, am I missing
something?
> +#define ftrace_override_function_with_return(fregs) \
> + override_function_with_return(&(fregs)->regs)
> +#define ftrace_regs_query_register_offset(name) \
^^^^^^
There seems to be a missing function here. Otherwise, the backslash
should be redundant. Did I understand correctly?
Best Regards,
Enze
> +
> #define ftrace_graph_func ftrace_graph_func
> void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
> struct ftrace_ops *op, struct ftrace_regs *fregs);
next prev parent reply other threads:[~2023-04-27 6:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 2:12 [PATCH v2 0/5] LoongArch: ftrace: Add direct call support and code simplification Youling Tang
2023-04-27 2:12 ` [PATCH v2 1/5] LoongArch: Fix build error if CONFIG_DYNAMIC_FTRACE_WITH_REGS is not set Youling Tang
2023-04-27 2:12 ` [PATCH v2 2/5] LoongArch: ftrace: Implement ftrace_find_callable_addr() to simplify code Youling Tang
2023-04-27 2:12 ` [PATCH v2 3/5] LoongArch: ftrace: Add direct call support Youling Tang
2023-04-27 2:12 ` [PATCH v2 4/5] LoongArch: ftrace: Add direct call trampoline samples support Youling Tang
2023-05-23 14:34 ` Steven Rostedt
2023-04-27 2:12 ` [PATCH v2 5/5] LoongArch: Abstract DYNAMIC_FTRACE_WITH_ARGS accesses Youling Tang
2023-04-27 6:16 ` Enze Li [this message]
2023-04-27 6:47 ` Youling Tang
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=87h6t17sux.fsf@kylinos.cn \
--to=lienze@kylinos.cn \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tangyouling@loongson.cn \
--cc=zhangqing@loongson.cn \
/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
all inboxes | Powered by JetHome®