@@ -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
*/
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(-)