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 <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
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)