Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/debug/debug_stream/debug_stream_thread_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <rtos/alloc.h>
#include <ipc/topology.h>
#include <stdio.h>
#include <string.h>
#include <soc.h>
#include <adsp_debug_window.h>

Expand Down Expand Up @@ -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);
Comment on lines +229 to +231
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new utilization LOG_INF can print misleading 100% utilization when runtime stats are unavailable (e.g., CONFIG_THREAD_RUNTIME_STATS disabled, ud->stats_valid false, or k_thread_runtime_stats_get() fails and thread_info_cpu_utilization returns 0). Please guard this log on stats availability (and ideally on a distinct “cpu usage valid” result) so 0% idle isn’t conflated with “unknown” idle load.

Suggested change
if (name && strncmp(name, "idle", 4) == 0)
LOG_INF("core %u utilization %u%%", ud->core,
100U - tinfo->cpu_usage * 100U / 255);
#ifdef CONFIG_THREAD_RUNTIME_STATS
if (ud->stats_valid && name && strncmp(name, "idle", 4) == 0) {
LOG_INF("core %u utilization %u%%", ud->core,
100U - tinfo->cpu_usage * 100U / 255);
}
#endif

Copilot uses AI. Check for mistakes.

ud->thread_count++;
}

Expand Down
Loading