From 72f87b38890f1cc78f44275fefd44906d07698b2 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 18 Sep 2023 18:38:51 +0300 Subject: [PATCH] ipc4: logging: fix builds with mtrace and probes both disabled If both SOF_PROBES and MTRACE logging backends are disabled at build time, IPC4 build failed due to undefined ipc4_logging_enable_logs(). Fixes a bug in commit 1721f7042638 ("logging: add logging through probes"). Signed-off-by: Kai Vehmanen --- src/ipc/ipc4/logging.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ipc/ipc4/logging.c b/src/ipc/ipc4/logging.c index a6d8e4ccce43..3b06dc1a2fc7 100644 --- a/src/ipc/ipc4/logging.c +++ b/src/ipc/ipc4/logging.c @@ -158,9 +158,8 @@ int ipc4_logging_enable_logs(bool first_block, return 0; } -#endif +#elif CONFIG_LOG_BACKEND_SOF_PROBE -#ifdef CONFIG_LOG_BACKEND_SOF_PROBE int ipc4_logging_enable_logs(bool first_block, bool last_block, uint32_t data_offset_or_size, @@ -196,6 +195,16 @@ int ipc4_logging_enable_logs(bool first_block, return 0; } +#else /* unsupported logging method */ + +int ipc4_logging_enable_logs(bool first_block, + bool last_block, + uint32_t data_offset_or_size, + const char *data) +{ + return IPC4_UNKNOWN_MESSAGE_TYPE; +} + #endif int ipc4_logging_shutdown(void)