Skip to content

Conversation

jsarha
Copy link

@jsarha jsarha commented Aug 23, 2024

This commit simply maps the identified debug-stream debug window slot as a debugfs file.

Copy link
Collaborator

@ujfalusi ujfalusi left a comment

Choose a reason for hiding this comment

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

@jsarha, what I would do is:
rename the ipc4-telemetry.c to ipc4-debugfs.c or something generic and use this to export the raw slots on the needed base.
You can have a single exported function as entry point, you can even move here the sof_ipc4_find_debug_slot_offset_by_type() function...

I know, mtrace is also uses debug slot, but it has been special cased out...

The ipc4-telemetry.h should remain as it is.

@jsarha jsarha force-pushed the debug-stream-debugfs branch from 672baba to 68be79a Compare August 30, 2024 07:24
@jsarha
Copy link
Author

jsarha commented Aug 30, 2024

@jsarha, what I would do is: rename the ipc4-telemetry.c to ipc4-debugfs.c or something generic and use this to export the raw slots on the needed base. You can have a single exported function as entry point, you can even move here the sof_ipc4_find_debug_slot_offset_by_type() function...

I know, mtrace is also uses debug slot, but it has been special cased out...

The ipc4-telemetry.h should remain as it is.

@ujfalusi I took a shot at this. I still try make sure the zephyr tool can still read the execption file.

@jsarha
Copy link
Author

jsarha commented Sep 25, 2024

@ujfalusi @kv2019i , according to my tests the exception debugfs file works just as well after this change as it did before. That is, neither version works. I have no idea where the problem is, but I am quite sure this version is equivalent to the older version, so I'd hope to get this merged.

@lgirdwood
Copy link
Member

@jsarha @ujfalusi ping - can we unblock ?

@jsarha
Copy link
Author

jsarha commented Oct 23, 2024

@jsarha @ujfalusi ping - can we unblock ?

This is not as important anymore as before, as the latest debug_stream.py is able to access its debug-window-slot directly using cavstool.py functions. However, I still think the debugfs file is a cleaner way to do this, so I still think this PR is valid.

@lgirdwood
Copy link
Member

@jsarha @ujfalusi ping - can we unblock ?

This is not as important anymore as before, as the latest debug_stream.py is able to access its debug-window-slot directly using cavstool.py functions. However, I still think the debugfs file is a cleaner way to do this, so I still think this PR is valid.

ok, we can park now and see how well existing tools work - if slow or inconsistent we can continue here.

ujfalusi
ujfalusi previously approved these changes Feb 11, 2025
lgirdwood
lgirdwood previously approved these changes Feb 13, 2025
@lgirdwood
Copy link
Member

@jsarha @ujfalusi ping - can we unblock ?

This is not as important anymore as before, as the latest debug_stream.py is able to access its debug-window-slot directly using cavstool.py functions. However, I still think the debugfs file is a cleaner way to do this, so I still think this PR is valid.

ok, we can park now and see how well existing tools work - if slow or inconsistent we can continue here.

I think this is useful in situations where no Python runtime is available. @ranj063 @ujfalusi @bardliao lets move forward with this.
@jsarha some conflicts.

@jsarha jsarha dismissed stale reviews from lgirdwood and ujfalusi via 2bd0077 June 25, 2025 15:00
@jsarha jsarha force-pushed the debug-stream-debugfs branch from 68be79a to 2bd0077 Compare June 25, 2025 15:00
@jsarha jsarha requested a review from lyakh as a code owner June 25, 2025 15:00
@jsarha
Copy link
Author

jsarha commented Jun 25, 2025

Rephrased the first commit message a bit and resurrected ipc4-telemetry.h in the last commit (and updated the message accordingly), which is currently actually used. The code still works with debug_stream.py.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM.

lyakh
lyakh previously approved these changes Jun 26, 2025
@jsarha
Copy link
Author

jsarha commented Jun 27, 2025

@lgirdwood , @lyakh , the phantom commit is now removed, and there was no complaints about the other commits, so this should be good now?

Thanks @ujfalusi !

lgirdwood
lgirdwood previously approved these changes Jun 27, 2025
bardliao
bardliao previously approved these changes Jun 30, 2025
Jyri Sarha added 4 commits July 1, 2025 22:32
Adds sof_ipc4_create_debug_slot_ro_debugfs_node() -function for
mapping a SOF Intel ipc4 debug window slot as debugfs file. The actual
slot is specified with slot_type parameter. The alternatives are
defined in include/sound/sof/ipc4/header.h and the slot is found with
sof_ipc4_find_debug_slot_offset_by_type(). It also takes the
data_offset parameter that specifies where the payload data in the
slot begins. The portion that is mapped to the debugfs file is
everything after the offset. The last parameter is the name of the
file.

Signed-off-by: Jyri Sarha <[email protected]>
Add new debug window slot type for debug-stream protocol. For details see
src/debug/debug_stream/debug_stream_slot.h under SOF sources [1].

[1] https://github.com/thesofproject/sof

Signed-off-by: Jyri Sarha <[email protected]>
Maps debug-stream debug window slot as read-only debugfs file with
sof_ipc4_create_debug_slot_ro_debugfs_node() -function.

Signed-off-by: Jyri Sarha <[email protected]>
… file

Remove sof_ipc4_create_exception_debugfs_node() and ipc4-telemetry.c,
and use sof_ipc4_create_debug_slot_ro_debugfs_node() instead for
mapping "exception" debugfs file.

In running system the SOF_IPC4_DEBUG_SLOT_TELEMETRY is used for
telemetry data, but if configured, Zephyr exception data is dumped in
the same debug window slot, right after the separator word.

Signed-off-by: Jyri Sarha <[email protected]>
@jsarha jsarha dismissed stale reviews from bardliao and lgirdwood via 7d84e22 July 1, 2025 19:49
@jsarha jsarha force-pushed the debug-stream-debugfs branch from b9782ad to 7d84e22 Compare July 1, 2025 19:49
@jsarha
Copy link
Author

jsarha commented Jul 1, 2025

@lyakh is this Ok now?

@bardliao , @lgirdwood only appled three last suggestions from Guennadi (Copyright 2024-2025), free in only one place sof_debug_slot_debugfs_entry_read(), and rename sof_ipc4_create_debug_slot_debugfs_node() to sof_ipc4_create_debug_slot_ro_debugfs_node() . Could you check those and reaprove if Ok.

@jsarha
Copy link
Author

jsarha commented Aug 13, 2025

@lgirdwood should we still get this merged? @ujfalusi should I rebase, the PR getting old, again?

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.

6 participants