[PATCH v2 13/16] ktime: Mark ktime_to_ns() notrace

From
Song Liu <song@kernel.org>
Date
2026-10-23 01:12:05
Also in
linux-trace-kernel, lkml
Reply to
Song Liu, 2026-10-23
The NMI safe accessors used as trace clocks, such as
ktime_get_mono_fast_ns() and ktime_get_boot_fast_ns(), are notrace and
call ktime_to_ns(). ktime_to_ns() is a plain inline function, so an
out-of-line copy is untraced only because inline implies notrace, and
tracing it would recurse through the trace clock.

Mark it notrace explicitly. No functional change.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
 include/linux/ktime.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index f247e564602f..ed56774f68ea 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -75,7 +75,7 @@ static inline ktime_t timespec64_to_ktime(struct timespec64 ts)
 #define ktime_to_timespec64(kt)		ns_to_timespec64((kt))
 
 /* Convert ktime_t to nanoseconds */
-static inline s64 ktime_to_ns(const ktime_t kt)
+static inline s64 notrace ktime_to_ns(const ktime_t kt)
 {
 	return kt;
 }
-- 
2.53.0-Meta
Thread (25 messages) 25 messages, 2 authors, last reply 8d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help