2024-06-07 09:00:00

by Yang Li

[permalink] [raw]
Subject: [PATCH -next 1/2] function_graph: Add kernel-doc comments for ftrace_graph_ret_addr() function

Added kernel-doc comments for the ftrace_graph_ret_addr() function to
improve code documentation and readability.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9299
Signed-off-by: Yang Li <[email protected]>
---
kernel/trace/fgraph.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index a13551a023aa..4ad33e4cb8da 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -872,6 +872,12 @@ ftrace_graph_get_ret_stack(struct task_struct *task, int idx)
/**
* ftrace_graph_ret_addr - convert a potentially modified stack return address
* to its original value
+ * @task: pointer to the task_struct of the task being examined
+ * @idx: pointer to a state variable, should be initialized to zero
+ * before the first call
+ * @ret: the current return address found on the stack
+ * @retp: pointer to the return address on the stack, ignored if
+ * HAVE_FUNCTION_GRAPH_RET_ADDR_PTR is not defined
*
* This function can be called by stack unwinding code to convert a found stack
* return address ('ret') to its original value, in case the function graph
--
2.20.1.7.g153144c



2024-06-10 22:21:48

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH -next 1/2] function_graph: Add kernel-doc comments for ftrace_graph_ret_addr() function

On Fri, 7 Jun 2024 16:49:56 +0800
Yang Li <[email protected]> wrote:

> Added kernel-doc comments for the ftrace_graph_ret_addr() function to
> improve code documentation and readability.
>
> Reported-by: Abaci Robot <[email protected]>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9299
> Signed-off-by: Yang Li <[email protected]>
> ---
> kernel/trace/fgraph.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> index a13551a023aa..4ad33e4cb8da 100644
> --- a/kernel/trace/fgraph.c
> +++ b/kernel/trace/fgraph.c
> @@ -872,6 +872,12 @@ ftrace_graph_get_ret_stack(struct task_struct *task, int idx)
> /**
> * ftrace_graph_ret_addr - convert a potentially modified stack return address
> * to its original value
> + * @task: pointer to the task_struct of the task being examined
> + * @idx: pointer to a state variable, should be initialized to zero
> + * before the first call

parameter descriptions should not go across more than one line. At least
not in my code. Also, you don't need to add that it needs to be initialized
here. That belongs in the body.

And it's not a state variable. The description you got that from is wrong.

I'll go update it and give you a reported by, as the entire description
needs a rewrite.

-- Steve


> + * @ret: the current return address found on the stack
> + * @retp: pointer to the return address on the stack, ignored if
> + * HAVE_FUNCTION_GRAPH_RET_ADDR_PTR is not defined
> *
> * This function can be called by stack unwinding code to convert a found stack
> * return address ('ret') to its original value, in case the function graph