[PATCH] tracing/timerlat: Move mutex interface_lock declaration outside CONFIG_TIMERLAT_TRACER
From: Lu Yao
Date: Tue Sep 10 2024 - 03:01:07 EST
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@xxxxxxxxxx>
---
kernel/trace/trace_osnoise.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
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
*/
--
2.25.1