Skip to content

Commit

Permalink
ftrace: Fix type of ftrace_graph_ent_entry.depth
Browse files Browse the repository at this point in the history
ftrace_graph_ent.depth is int, but ftrace_graph_ent_entry.depth is
unsigned long. This confuses trace-cmd on 64-bit big-endian systems and
makes it print a huge amount of spaces. Fix this by using unsigned int,
which has a matching size, instead.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/20250412221847.17310-2-iii@linux.ibm.com
Fixes: ff5c9c5 ("ftrace: Add support for function argument to graph tracer")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
Ilya Leoshkevich authored and Steven Rostedt (Google) committed Apr 17, 2025
1 parent 92f1d3b commit 3b4e87e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_entries.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ FTRACE_ENTRY(funcgraph_entry, ftrace_graph_ent_entry,
F_STRUCT(
__field_struct( struct ftrace_graph_ent, graph_ent )
__field_packed( unsigned long, graph_ent, func )
__field_packed( unsigned long, graph_ent, depth )
__field_packed( unsigned int, graph_ent, depth )
__dynamic_array(unsigned long, args )
),

F_printk("--> %ps (%lu)", (void *)__entry->func, __entry->depth)
F_printk("--> %ps (%u)", (void *)__entry->func, __entry->depth)
);

#ifdef CONFIG_FUNCTION_GRAPH_RETADDR
Expand Down

0 comments on commit 3b4e87e

Please sign in to comment.