diff mbox series

iwlwifi: mei: allow tracing to be disabled

Message ID 20211205131637.3203040-1-arnd@kernel.org (mailing list archive)
State Handled Elsewhere
Delegated to: Luca Coelho
Headers show
Series iwlwifi: mei: allow tracing to be disabled | expand

Commit Message

Arnd Bergmann Dec. 5, 2021, 1:16 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The Makefile conditionally leaves out the trace implementation,
but it gets called unconditionally:

ERROR: modpost: "__SCT__tp_func_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
ERROR: modpost: "__tracepoint_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
ERROR: modpost: "__SCT__tp_func_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
ERROR: modpost: "__tracepoint_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
ERROR: modpost: "__SCT__tp_func_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
ERROR: modpost: "__tracepoint_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!

Use the same macro incantation that is used in the main iwlwifi driver
to leave out the tracing when CONFIG_IWLWIFI_DEVICE_TRACING is disabled.

Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/intel/iwlwifi/mei/trace.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Emmanuel Grumbach Dec. 5, 2021, 6:12 p.m. UTC | #1
> Subject: [PATCH] iwlwifi: mei: allow tracing to be disabled
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The Makefile conditionally leaves out the trace implementation, but it gets
> called unconditionally:
> 
> ERROR: modpost: "__SCT__tp_func_iwlmei_me_msg"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_me_msg"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCT__tp_func_iwlmei_sap_cmd"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_sap_cmd"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCT__tp_func_iwlmei_sap_data"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_sap_data"
> [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> 
> Use the same macro incantation that is used in the main iwlwifi driver to
> leave out the tracing when CONFIG_IWLWIFI_DEVICE_TRACING is disabled.
> 
> Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with
> CSME")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for this, but Kalle just merged a fix I had already sent.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/trace.h b/drivers/net/wireless/intel/iwlwifi/mei/trace.h
index 6f673f2817ad..2742c90fedab 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/trace.h
+++ b/drivers/net/wireless/intel/iwlwifi/mei/trace.h
@@ -8,6 +8,17 @@ 
 
 #include <linux/tracepoint.h>
 
+#if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
+#undef TRACE_EVENT
+#define TRACE_EVENT(name, proto, ...) \
+static inline void trace_ ## name(proto) {}
+#undef DECLARE_EVENT_CLASS
+#define DECLARE_EVENT_CLASS(...)
+#undef DEFINE_EVENT
+#define DEFINE_EVENT(evt_class, name, proto, ...) \
+static inline void trace_ ## name(proto) {}
+#endif
+
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM iwlmei_sap_cmd