Skip to content

Commit e2baaaf

Browse files
committed
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 <kai.vehmanen@linux.intel.com>
1 parent 678de87 commit e2baaaf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/debug/debug_stream/debug_stream_thread_info.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <rtos/alloc.h>
88
#include <ipc/topology.h>
99
#include <stdio.h>
10+
#include <string.h>
1011
#include <soc.h>
1112
#include <adsp_debug_window.h>
1213

@@ -225,6 +226,10 @@ static void thread_info_cb(const struct k_thread *cthread, void *user_data)
225226
tinfo->name, tinfo->stack_usage * 100U / 255,
226227
tinfo->cpu_usage * 100U / 255);
227228

229+
if (name && strncmp(name, "idle", 4) == 0)
230+
LOG_INF("core %u utilization %u%%", ud->core,
231+
100U - tinfo->cpu_usage * 100U / 255);
232+
228233
ud->thread_count++;
229234
}
230235

0 commit comments

Comments
 (0)