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

From: Song Liu

Date: Thu Oct 22 2026 - 21:12:50 EST


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@xxxxxxxxxx>
---
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