From e2baaafea7f5a85fdd70f66e7b5521576d95e7cd Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Tue, 24 Mar 2026 18:18:53 +0200 Subject: [PATCH] debug: debug_stream: log per-core utilization from idle thread load Keep the per-thread stack and cpu LOG_DBG print and add a separate LOG_INF that fires only for the Zephyr idle thread. The info-level print reports per-core CPU utilization calculated as the inverse of the idle thread load percentage. Signed-off-by: Kai Vehmanen --- src/debug/debug_stream/debug_stream_thread_info.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/debug/debug_stream/debug_stream_thread_info.c b/src/debug/debug_stream/debug_stream_thread_info.c index 4b47df638158..158f1525ae0f 100644 --- a/src/debug/debug_stream/debug_stream_thread_info.c +++ b/src/debug/debug_stream/debug_stream_thread_info.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -225,6 +226,10 @@ static void thread_info_cb(const struct k_thread *cthread, void *user_data) tinfo->name, tinfo->stack_usage * 100U / 255, tinfo->cpu_usage * 100U / 255); + if (name && strncmp(name, "idle", 4) == 0) + LOG_INF("core %u utilization %u%%", ud->core, + 100U - tinfo->cpu_usage * 100U / 255); + ud->thread_count++; }