[PATCH] sched/clock: Make local_clock() notrace
From: Steven Rostedt
Date: Tue Feb 20 2024 - 20:18:31 EST
From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
The "perf" clock in /sys/kernel/tracing/trace_clock enables local_clock(),
where on machines that have CONFIG_HAVE_UNSTABLE_SCHED_CLOCK set is a
normal function. This function can be traced.
I found that enabling the "perf" clock on some debug configs and running
function tracer can live lock the machine. That is, it goes so slow that
nothing moves forward.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: fb7d4948c4da2 ("sched/clock: Provide local_clock_noinstr()")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
kernel/sched/clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index 3c6193de9cde..af8b698dee8c 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -308,7 +308,7 @@ noinstr u64 local_clock_noinstr(void)
return clock;
}
-u64 local_clock(void)
+notrace u64 local_clock(void)
{
u64 now;
preempt_disable_notrace();
--
2.43.0