* [PATCH v2] function_graph: Fix args pointer mismatch in print_graph_retval()
@ 2026-01-12 2:16 Donglin Peng
2026-01-23 17:18 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Donglin Peng @ 2026-01-12 2:16 UTC (permalink / raw)
To: rostedt; +Cc: mhiramat, linux-trace-kernel, linux-kernel, Donglin Peng
From: Donglin Peng <pengdonglin@xiaomi.com>
When funcgraph-args and funcgraph-retaddr are both enabled, many kernel
functions display invalid parameters in trace logs[1].
The issue occurs because print_graph_retval() passes a mismatched args
pointer to print_function_args(). Fix this by retrieving the correct
args pointer using the FGRAPH_ENTRY_ARGS() macro.
[1] https://gitee.com/pengdonglin137/funcgraph_visualization/raw/master/samples/error_args.png
Fixes: f83ac7544fbf ("function_graph: Enable funcgraph-args and funcgraph-retaddr to work simultaneously")
Signed-off-by: Donglin Peng <pengdonglin@xiaomi.com>
---
kernel/trace/trace_functions_graph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index b1e9c9913309..1de6f1573621 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -901,7 +901,7 @@ static void print_graph_retval(struct trace_seq *s, struct ftrace_graph_ent_entr
trace_seq_printf(s, "%ps", func);
if (args_size >= FTRACE_REGS_MAX_ARGS * sizeof(long)) {
- print_function_args(s, entry->args, (unsigned long)func);
+ print_function_args(s, FGRAPH_ENTRY_ARGS(entry), (unsigned long)func);
trace_seq_putc(s, ';');
} else
trace_seq_puts(s, "();");
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] function_graph: Fix args pointer mismatch in print_graph_retval()
2026-01-12 2:16 [PATCH v2] function_graph: Fix args pointer mismatch in print_graph_retval() Donglin Peng
@ 2026-01-23 17:18 ` Steven Rostedt
2026-01-30 1:13 ` Donglin Peng
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2026-01-23 17:18 UTC (permalink / raw)
To: Donglin Peng; +Cc: mhiramat, linux-trace-kernel, linux-kernel, Donglin Peng
On Mon, 12 Jan 2026 10:16:01 +0800
Donglin Peng <dolinux.peng@gmail.com> wrote:
> From: Donglin Peng <pengdonglin@xiaomi.com>
>
> When funcgraph-args and funcgraph-retaddr are both enabled, many kernel
> functions display invalid parameters in trace logs[1].
>
> The issue occurs because print_graph_retval() passes a mismatched args
> pointer to print_function_args(). Fix this by retrieving the correct
> args pointer using the FGRAPH_ENTRY_ARGS() macro.
>
> [1] https://gitee.com/pengdonglin137/funcgraph_visualization/raw/master/samples/error_args.png
Please do not provide links to images. This stays in the git logs for the
lifetime of the Linux kernel. Images like this will likely not live as long
and the link becomes wasted space in the git history.
Either do a cut and paste of the bad output, or don't include it at all.
-- Steve
> Fixes: f83ac7544fbf ("function_graph: Enable funcgraph-args and funcgraph-retaddr to work simultaneously")
> Signed-off-by: Donglin Peng <pengdonglin@xiaomi.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] function_graph: Fix args pointer mismatch in print_graph_retval()
2026-01-23 17:18 ` Steven Rostedt
@ 2026-01-30 1:13 ` Donglin Peng
0 siblings, 0 replies; 3+ messages in thread
From: Donglin Peng @ 2026-01-30 1:13 UTC (permalink / raw)
To: Steven Rostedt; +Cc: mhiramat, linux-trace-kernel, linux-kernel, Donglin Peng
On Sat, Jan 24, 2026 at 1:18 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Mon, 12 Jan 2026 10:16:01 +0800
> Donglin Peng <dolinux.peng@gmail.com> wrote:
>
> > From: Donglin Peng <pengdonglin@xiaomi.com>
> >
> > When funcgraph-args and funcgraph-retaddr are both enabled, many kernel
> > functions display invalid parameters in trace logs[1].
> >
> > The issue occurs because print_graph_retval() passes a mismatched args
> > pointer to print_function_args(). Fix this by retrieving the correct
> > args pointer using the FGRAPH_ENTRY_ARGS() macro.
> >
> > [1] https://gitee.com/pengdonglin137/funcgraph_visualization/raw/master/samples/error_args.png
>
> Please do not provide links to images. This stays in the git logs for the
> lifetime of the Linux kernel. Images like this will likely not live as long
> and the link becomes wasted space in the git history.
Thanks for pointing this out.
>
> Either do a cut and paste of the bad output, or don't include it at all.
Thanks.
>
> -- Steve
>
>
> > Fixes: f83ac7544fbf ("function_graph: Enable funcgraph-args and funcgraph-retaddr to work simultaneously")
> > Signed-off-by: Donglin Peng <pengdonglin@xiaomi.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-30 1:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 2:16 [PATCH v2] function_graph: Fix args pointer mismatch in print_graph_retval() Donglin Peng
2026-01-23 17:18 ` Steven Rostedt
2026-01-30 1:13 ` Donglin Peng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox