Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions src/debug/debug_stream/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ config SOF_DEBUG_STREAM_THREAD_INFO_INTERVAL
Decides how often thread info runs and checks execution cycle
statistics and stack usage.

config SOF_DEBUG_STREAM_THREAD_INFO_TOTAL_CPU_LOAD_TO_LOG
bool "Print summarized total CPU load to log subsystem"
depends on SOF_DEBUG_STREAM_THREAD_INFO
default y
help
In addition to printing thread statistics to debug stream,
print the total CPU load (sum of all threads) to
the logging system.

config SOF_DEBUG_STREAM_TEXT_MSG
bool "Enable text message sending through Debug-Stream"
help
Expand Down
7 changes: 7 additions & 0 deletions src/debug/debug_stream/debug_stream_thread_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ 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);

/* .is_idle depends on CONFIG_SMP */
#if defined(CONFIG_SOF_DEBUG_STREAM_THREAD_INFO_TOTAL_CPU_LOAD_TO_LOG) && defined(CONFIG_SMP)
if (thread->base.is_idle)
LOG_INF("core %u utilization %u%%", ud->core,
100U - tinfo->cpu_usage * 100U / 255);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do we need a print? The debug-stream dump already shows how much the idle thread consumes, I'd think if we enable the debug stream, we want to see the information exactly there - in the debug stream, not in the log?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@lyakh That's a fair question. My problem: I want to see CPU utilization during testing and I don't want to run deug_stream python client as that busyloops on the SRAM window (versus mtrace that uses interrupts to wake-up host to read). With DP modules added, our old CPU load mechamisms (that print LL load to mtrace) don't work anymore, so I need something more.

@jsarha What do you think? Should I make this optional? Or just keep on my personal branch?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If its on a personal branch then its useful. Pls keep it.

#endif

ud->thread_count++;
}

Expand Down
Loading