Skip to content

Commit

Permalink
debug: debug_stream_thread_info: Thread info records over debug stream
Browse files Browse the repository at this point in the history
Implementation for collecting Thread stack and CPU usage statistic from
Zephyr core and send the info and debug_stream records. The records
encoding is defined and documented in debug_stream_thread_info.c
source file.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
  • Loading branch information
Jyri Sarha committed Sep 5, 2024
1 parent 7673c8a commit aef4ee3
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/debug/debug_stream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources_ifdef(CONFIG_SOF_DEBUG_STREAM_SLOT sof debug_stream_slot.c)

add_local_sources_ifdef(CONFIG_SOF_DEBUG_STREAM_THREAD_INFO sof debug_stream_thread_info.c)
23 changes: 22 additions & 1 deletion src/debug/debug_stream/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,26 @@ config SOF_DEBUG_STREAM_SLOT_NUMBER
used for descriptors, so for slot 3 to be mapped, the WIN_2_SIZE
must be (1 + 3) * 4k = 16k or greater.

endif
config SOF_DEBUG_STREAM_THREAD_INFO
bool "Enable Zephyr thread info reporting through Debug-Stream"
select INIT_STACKS
select THREAD_MONITOR
select THREAD_STACK_INFO
select THREAD_RUNTIME_STATS
help
This activates Zephyr thread info reporting through
Debug-Stream. Thread info reports some basic live data from
the Zephyr threads, like stack usage high-water-mark and CPU
usage. Please select THREAD_NAME=y for the thread names more
than just hex numbers.

config SOF_DEBUG_STREAM_THREAD_INFO_INTERVAL
int "Thread information collection interval in seconds"
depends on SOF_DEBUG_STREAM_THREAD_INFO
default 2
range 1 10
help
Decides how often thread info runs and checks execution cycle
statistics and stack usage.

endif
Loading

0 comments on commit aef4ee3

Please sign in to comment.