From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Uros Bizjak <ubizjak@gmail.com>
Subject: [for-next][PATCH 10/10] tracing: Use atomic64_inc_return() in trace_clock_counter()
Date: Thu, 10 Oct 2024 10:25:47 -0400 [thread overview]
Message-ID: <20241010142551.130902358@goodmis.org> (raw)
In-Reply-To: 20241010142537.255433162@goodmis.org
From: Uros Bizjak <ubizjak@gmail.com>
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>
---
kernel/trace/trace_clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
--
2.45.2
prev parent reply other threads:[~2024-10-10 14:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 14:25 [for-next][PATCH 00/10] tracing: Updates for 6.13 Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 01/10] tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 02/10] tracing/ftrace: disable preemption in syscall probe Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 03/10] tracing/perf: " Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 04/10] tracing/bpf: " Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 05/10] tracing: Allow system call tracepoints to handle page faults Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 06/10] tracing/ftrace: Add might_fault check to syscall probes Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 07/10] tracing/perf: " Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 08/10] tracing/bpf: " Steven Rostedt
2024-10-10 14:25 ` [for-next][PATCH 09/10] trace/trace_event_perf: remove duplicate samples on the first tracepoint event Steven Rostedt
2024-10-10 14:25 ` Steven Rostedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241010142551.130902358@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox