Commit c9703d17 authored by Donglin Peng's avatar Donglin Peng Committed by Steven Rostedt (Google)
Browse files

function_graph: Fix args pointer mismatch in print_graph_retval()

When funcgraph-args and funcgraph-retaddr are both enabled, many kernel
functions display invalid parameters in trace logs.

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.

Link: https://patch.msgid.link/20260112021601.1300479-1-dolinux.peng@gmail.com


Fixes: f83ac754 ("function_graph: Enable funcgraph-args and funcgraph-retaddr to work simultaneously")
Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarDonglin Peng <pengdonglin@xiaomi.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 00f13e28
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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, "();");