diff mbox series

tracing/timerlat: Move mutex interface_lock declaration outside CONFIG_TIMERLAT_TRACER

Message ID 20240910070025.132633-1-yaolu@kylinos.cn (mailing list archive)
State Accepted
Commit af178143343028fdec9d5960a22d17f5587fd3f5
Headers show
Series tracing/timerlat: Move mutex interface_lock declaration outside CONFIG_TIMERLAT_TRACER | expand

Commit Message

Lu Yao Sept. 10, 2024, 7 a.m. UTC
Fix compile error without CONFIG_TIMERLAT_TRACER:

../kernel/trace/trace_osnoise.c: In function ‘osnoise_sleep’:
../kernel/trace/trace_osnoise.c:1631:14: error: ‘interface_lock’ undeclared (first use in this function); did you mean ‘trace_clock’?
 1631 |  mutex_lock(&interface_lock);
      |              ^~~~~~~~~~~~~~
      |              trace_clock

Fixes: e6a53481da29 ("tracing/timerlat: Only clear timer if a kthread exists")
Signed-off-by: Lu Yao <yaolu@kylinos.cn>
---
 kernel/trace/trace_osnoise.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index bbe47781617e..7e75c1214b36 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -228,6 +228,11 @@  static inline struct osnoise_variables *this_cpu_osn_var(void)
 	return this_cpu_ptr(&per_cpu_osnoise_var);
 }
 
+/*
+ * Protect the interface.
+ */
+static struct mutex interface_lock;
+
 #ifdef CONFIG_TIMERLAT_TRACER
 /*
  * Runtime information for the timer mode.
@@ -252,11 +257,6 @@  static inline struct timerlat_variables *this_cpu_tmr_var(void)
 	return this_cpu_ptr(&per_cpu_timerlat_var);
 }
 
-/*
- * Protect the interface.
- */
-static struct mutex interface_lock;
-
 /*
  * tlat_var_reset - Reset the values of the given timerlat_variables
  */