Skip to content

Commit 761ef34

Browse files
iii-irostedt
authored andcommitted
ftrace: Expose call graph depth as unsigned int
Depth is stored as int because the code uses negative values to break out of iterations. But what is recorded is always zero or positive. So expose it as unsigned int instead of int. 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-3-iii@linux.ibm.com Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 88cefd9 commit 761ef34

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

kernel/trace/trace_entries.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ FTRACE_ENTRY_PACKED(fgraph_retaddr_entry, fgraph_retaddr_ent_entry,
9797
F_STRUCT(
9898
__field_struct( struct fgraph_retaddr_ent, graph_ent )
9999
__field_packed( unsigned long, graph_ent, func )
100-
__field_packed( int, graph_ent, depth )
100+
__field_packed( unsigned int, graph_ent, depth )
101101
__field_packed( unsigned long, graph_ent, retaddr )
102102
),
103103

104-
F_printk("--> %ps (%d) <- %ps", (void *)__entry->func, __entry->depth,
104+
F_printk("--> %ps (%u) <- %ps", (void *)__entry->func, __entry->depth,
105105
(void *)__entry->retaddr)
106106
);
107107

@@ -124,13 +124,13 @@ FTRACE_ENTRY_PACKED(funcgraph_exit, ftrace_graph_ret_entry,
124124
__field_struct( struct ftrace_graph_ret, ret )
125125
__field_packed( unsigned long, ret, func )
126126
__field_packed( unsigned long, ret, retval )
127-
__field_packed( int, ret, depth )
127+
__field_packed( unsigned int, ret, depth )
128128
__field_packed( unsigned int, ret, overrun )
129129
__field(unsigned long long, calltime )
130130
__field(unsigned long long, rettime )
131131
),
132132

133-
F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d retval: %lx",
133+
F_printk("<-- %ps (%u) (start: %llx end: %llx) over: %u retval: %lx",
134134
(void *)__entry->func, __entry->depth,
135135
__entry->calltime, __entry->rettime,
136136
__entry->depth, __entry->retval)
@@ -146,13 +146,13 @@ FTRACE_ENTRY_PACKED(funcgraph_exit, ftrace_graph_ret_entry,
146146
F_STRUCT(
147147
__field_struct( struct ftrace_graph_ret, ret )
148148
__field_packed( unsigned long, ret, func )
149-
__field_packed( int, ret, depth )
149+
__field_packed( unsigned int, ret, depth )
150150
__field_packed( unsigned int, ret, overrun )
151151
__field(unsigned long long, calltime )
152152
__field(unsigned long long, rettime )
153153
),
154154

155-
F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d",
155+
F_printk("<-- %ps (%u) (start: %llx end: %llx) over: %u",
156156
(void *)__entry->func, __entry->depth,
157157
__entry->calltime, __entry->rettime,
158158
__entry->depth)

0 commit comments

Comments
 (0)