-
Notifications
You must be signed in to change notification settings - Fork 349
Debug stream text msg #10396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug stream text msg #10396
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds text message sending functionality to the debug stream system, allowing developers to send debug messages that persist in the debug window even after a crash. This supplements existing debug stream capabilities with a simple text-based messaging interface.
Key Changes:
- Added new
ds_msg()function for sending formatted text messages through the debug stream - Implemented Python parser support for the new text message record type
- Added configuration option
CONFIG_SOF_DEBUG_STREAM_TEXT_MSGto enable the feature
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/debug_stream/debug_stream.py | Added TextMsg structure and parsing logic for text message records |
| src/include/user/debug_stream_text_msg.h | Defined header file with text message structure and ds_msg() function declaration |
| src/include/user/debug_stream.h | Added DEBUG_STREAM_RECORD_ID_TEXT_MSG constant for the new record type |
| src/debug/debug_stream/debug_stream_text_msg.c | Implemented ds_msg() function with formatted message support |
| src/debug/debug_stream/Kconfig | Added configuration option for enabling text message functionality |
| src/debug/debug_stream/CMakeLists.txt | Added conditional compilation for text message source file |
| app/debug_stream_overlay.conf | Enabled text message feature in debug stream configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e06bd61 to
8a88f29
Compare
Add new record type for simple text messages to the debug stream protocol and a function for sending the messages. This functionality is for debugging purposes when for some reason or another the usual methods do not work. ds_msg() can be used like printf and the printed messages can be displayed on host side with debug_stream.py. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
8a88f29 to
cc1a054
Compare
Add support for showing DEBUG_STREAM_RECORD_ID_TEXT_MSG messages that can be sent from firmware code with sd_msg() command. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Enable debug messages in debug_stream_overlay.conf Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add reference to tools/debug_stream/debug_stream.py in the Kconfig help message. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
|
Copilot pointed copy-paste errors fixed. |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one open.
| struct { | ||
| struct debug_stream_text_msg msg; | ||
| char text[128]; | ||
| } __packed buf = { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, how does Python parse C structures - it probably assumes "normal" (default) packing, i.e. as if no __packed attribute was specified. Can you tell Python that the structure is packed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "_pack_ = 1" in Class(ctypes.Structure) does it. But in this context it does not really matter as the "struct debug_stream_text_msg" size is 32-bit aligned and what remains after that is all cosidered utf-8 encoded string.
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go.
| _fields_ = [ | ||
| ("id", ctypes.c_uint), | ||
| ("seqno", ctypes.c_uint), | ||
| ("size_words", ctypes.c_uint), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in commit: sd_msg->ds_msg
Add simple text message sending functionality to debug stream. This can be useful sometimes in debugging when other methods fail. The last messages should be visible in the debug window even after the crash.