Re: [PATCH v4 2/4] ftrace: Add support for function argument to graph tracer

From: Steven Rostedt
Date: Fri Apr 11 2025 - 13:00:46 EST


On Fri, 11 Apr 2025 12:48:49 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Fri, 11 Apr 2025 12:45:52 -0400
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > Also, is it possible to just enable function_graph tarcing and see if it
> > adds these blank lines between events?
>
> Never mind. When I enable the funcgraph-retval option, I get the blank
> lines too.
>
> There's likely an added '\n' that shouldn't be. Let me go look.
>

Found it, and yes it is the commit you bisected it to:

It added a '\n' when the retval option would print one too.

This should fix it:

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 2f077d4158e5..718f6e84cc83 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -971,11 +971,10 @@ print_graph_entry_leaf(struct trace_iterator *iter,

if (args_size >= FTRACE_REGS_MAX_ARGS * sizeof(long)) {
print_function_args(s, entry->args, ret_func);
- trace_seq_putc(s, ';');
+ trace_seq_puts(s, ";\n");
} else
- trace_seq_puts(s, "();");
+ trace_seq_puts(s, "();\n");
}
- trace_seq_printf(s, "\n");

print_graph_irq(iter, graph_ret->func, TRACE_GRAPH_RET,
cpu, iter->ent->pid, flags);
-- Steve