Skip to content

Commit eb887c4

Browse files
ubizjakrostedt
authored andcommitted
tracing: Use atomic64_inc_return() in trace_clock_counter()
Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref) to use optimized implementation and ease register pressure around the primitive for targets that implement optimized variant. Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20241007085651.48544-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent afe5960 commit eb887c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,5 @@ static atomic64_t trace_counter;
154154
*/
155155
u64 notrace trace_clock_counter(void)
156156
{
157-
return atomic64_add_return(1, &trace_counter);
157+
return atomic64_inc_return(&trace_counter);
158158
}

0 commit comments

Comments
 (0)