summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2024-10-07 10:56:28 +0200
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-10-10 01:59:49 +0200
commiteb887c4567d1b0e7684c026fe7df44afa96589e6 (patch)
tree7dd9dda1a664633832caeb06abdd1d11197c89cd /kernel
parenttrace/trace_event_perf: remove duplicate samples on the first tracepoint event (diff)
downloadlinux-eb887c4567d1b0e7684c026fe7df44afa96589e6.tar.xz
linux-eb887c4567d1b0e7684c026fe7df44afa96589e6.zip
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
index 4702efb00ff2..4cb2ebc439be 100644
--- a/kernel/trace/trace_clock.c
+++ b/kernel/trace/trace_clock.c
@@ -154,5 +154,5 @@ static atomic64_t trace_counter;
*/
u64 notrace trace_clock_counter(void)
{
- return atomic64_add_return(1, &trace_counter);
+ return atomic64_inc_return(&trace_counter);
}