Skip to content
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

[DNM] debug: debug_stream: Access debug slot directly using cavstool.py #9498

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jsarha
Copy link
Contributor

@jsarha jsarha commented Sep 20, 2024

Access debug slot directly using cavstool.py, by specifying the debug slot number where the debug_stream data is transferred.

Adds one command line parameter for selecting the debug slot directly, adds an alternative mainloop for polling the slot through cavstool.py direct access, and relaxes some often occurring warning print. The warning prints happen when the FW boots and the cavstool code wakes up before the init code has initialized the slot.

NOTE:
This code depends from this PR: zephyrproject-rtos/zephyr#78753 . However, since the import line is in the function that is only called if the --direct-access-slot flag is present, the old code will still work without cavstool.py, but that would in turn need this PR: thesofproject/linux#5154

@jsarha
Copy link
Contributor Author

jsarha commented Sep 20, 2024

My latest cleanups were still un committed, thus the last update.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Let's sync with the version of cavstool.py that will get merged. Current version fails to

AttributeError: module 'cavstool' has no attribute 'fw_is_alive_dsp'. Did you mean: 'fw_is_alive'?

@jsarha jsarha force-pushed the debug_stream_thread_info_cavstool_access branch from cafdef9 to 5c1957e Compare September 24, 2024 12:49
@jsarha
Copy link
Contributor Author

jsarha commented Sep 24, 2024

Latest push added some robustness improvements to the python script and config overlay for building debug_stream_thread_info.

@jsarha jsarha force-pushed the debug_stream_thread_info_cavstool_access branch from 5c1957e to 4bfe83a Compare September 26, 2024 14:15
@jsarha
Copy link
Contributor Author

jsarha commented Sep 26, 2024

The important part of this PR - the debug_stream.py direct access - is now split in two:

  1. The basic functionality that depends on: Make cavstool code more shareable zephyrproject-rtos/zephyr#78753

    • Some more cleaning up usability improvements on top of previous version
  2. A usability improvement to always just work if at all possible, depends on: Cavstool debug slot offset by type zephyrproject-rtos/zephyr#79061

Then there is the debug_stream_overlay.conf added that is identical to the previous version and on simple typo fix commit.

@lgirdwood
Copy link
Member

@jsarha does this PR depend on the Zephyr PRs ? if so , lets mark as DNM until Zephyr parts merged.

Jyri Sarha added 4 commits September 27, 2024 10:12
Access debug slot directly using cavstool.py, by specifying the debug
slot number where the debug_stream data is transferred.

Adds one command line parameter for selecting the debug slot directly
and adds an alternative mainloop for polling the slot through
cavstool.py direct access.

The commit also adds quite a few data consistency checks and error
handling improvements as with the direct memory access its much more
likely to get inconsistent data when the DSP is booting up, and code
needs to be robust enough not to crash in such a situation. Also the
logging messages about those checks failing has been lowered so that
they are not too noisy.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
The new cavstool.debug_slot_offset_by_type() opens an opportunity to
improve debug_stream.py usability a bit. If the debugfs file is not
found, then try to find the correct debug slot the correct slot using
cavstool direct access and debug_slot_offset_by_type().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add overlay to build debug_stream protocol over a debug window slot,
make room for the slot, and send thread info data through it.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
A simple typo fix to a logging message.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha jsarha force-pushed the debug_stream_thread_info_cavstool_access branch from 4bfe83a to e040178 Compare September 27, 2024 07:17
@jsarha
Copy link
Contributor Author

jsarha commented Sep 27, 2024

Fixed couple of simple codestyle issues found by checkpatch.

@jsarha
Copy link
Contributor Author

jsarha commented Sep 27, 2024

@jsarha does this PR depend on the Zephyr PRs ? if so , lets mark as DNM until Zephyr parts merged.

The script actually does not stop from working even if the cavstool.py changes are not available, that is, if the debugfs file is there. But maybe the error messages if trying to use -c flag are too confusing. I'll add the tag.

@jsarha jsarha changed the title debug: debug_stream: Access debug slot directly using cavstool.py [DMN] debug: debug_stream: Access debug slot directly using cavstool.py Sep 27, 2024
@jsarha jsarha changed the title [DMN] debug: debug_stream: Access debug slot directly using cavstool.py [DNM] debug: debug_stream: Access debug slot directly using cavstool.py Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants