From 297bd5087c28c7c9ab9062dd080e9babe02f6a04 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Fri, 28 Feb 2025 15:51:54 +0100 Subject: [PATCH 1/3] [CIONLY] west: test for PR 86473 in zephyr I am only testing the PR in Zephyr. Signed-off-by: Tomasz Leman --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 7be1028f0985..73a341e2fba5 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: fe29c40a9366b5ffdcdd2eac26023ce4502413b1 + revision: pull/86473/head remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From 4d573670d81dddf832d44d13625c1a37efcc1b29 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Mon, 3 Mar 2025 09:33:56 +0100 Subject: [PATCH 2/3] debug: enable mtrace autostart in debug overlay This patch updates the debug overlay configuration to enable the `LOG_BACKEND_ADSP_MTRACE_AUTOSTART` option. By setting this option to 'y', the ADSP mtrace logging backend will automatically start in the debug overlay, facilitating detailed logging for debugging purposes. This change allows developers to capture comprehensive logs during debugging sessions, aiding in the identification and resolution of issues. Signed-off-by: Tomasz Leman --- app/debug_overlay.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/app/debug_overlay.conf b/app/debug_overlay.conf index 3827976086d8..23a7d2bcabb6 100644 --- a/app/debug_overlay.conf +++ b/app/debug_overlay.conf @@ -15,3 +15,4 @@ CONFIG_DAI_VERBOSE_GLITCH_WARNINGS=y # CONFIG_SYS_HEAP_VALIDATE=y # CONFIG_SPIN_VALIDATE=y # CONFIG_SPIN_LOCK_TIME_LIMIT=50000 +CONFIG_LOG_BACKEND_ADSP_MTRACE_AUTOSTART=y \ No newline at end of file From 09a0fb46b4a9fe63d22b66140bb0d1bb427aa568 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Mon, 3 Mar 2025 16:04:29 +0100 Subject: [PATCH 3/3] logging: fix mtrace backend activation on IPC log enable This patch addresses an issue where logs were not being collected after an IPC message when the mtrace autostart was disabled in regular builds. The problem was resolved by replacing `log_backend_activate` and `log_backend_deactivate` with `log_backend_enable` and `log_backend_disable`, respectively. These functions ensure that the backend is properly enabled with the initial maximum filtering level and disabled when necessary. This change ensures that logging behavior aligns with the intended configuration, allowing logs to be collected as expected after an IPC message. Signed-off-by: Tomasz Leman --- src/ipc/ipc4/logging.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ipc/ipc4/logging.c b/src/ipc/ipc4/logging.c index 01a981435e6e..14e814509c4b 100644 --- a/src/ipc/ipc4/logging.c +++ b/src/ipc/ipc4/logging.c @@ -15,8 +15,8 @@ #include #include #if !CONFIG_LIBRARY -#include #include +#include #endif #if CONFIG_LOG_BACKEND_SOF_PROBE #include @@ -135,8 +135,7 @@ int ipc4_logging_enable_logs(bool first_block, if (log_state->enable) { adsp_mtrace_log_init(mtrace_log_hook); - - log_backend_activate(log_backend, mtrace_log_hook); + log_backend_enable(log_backend, mtrace_log_hook, CONFIG_SOF_LOG_LEVEL); mtrace_aging_timer = log_state->aging_timer_period; if (mtrace_aging_timer < IPC4_MTRACE_AGING_TIMER_MIN_MS) { @@ -150,7 +149,7 @@ int ipc4_logging_enable_logs(bool first_block, schedule_task(&mtrace_task, mtrace_aging_timer * 1000, 0); } else { adsp_mtrace_log_init(NULL); - log_backend_deactivate(log_backend); + log_backend_disable(log_backend); schedule_task_cancel(&mtrace_task); }