-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core/sched: Provide thread state names for OpenOCD #18460
base: master
Are you sure you want to change the base?
Conversation
This provides the thread state names as used in ps() as a symbol that OpenOCD can read out. This allows implementing OpenOCD's RIOT awareness in a way that changes to thread states can be picked up at runtime, without having to patch OpenOCD for every change. Apparently RIOT is a bit faster moving in this regard than other bare metal RTOSes.
Note: I think this should be fully reviewed as usual now. But before merging, IMO it would be best to wait for a positive signal from the OpenOCD side (at least in regard to the RIOT-side of the changes). |
Instead of adding all those strings to ROM, I prefer the idea that @bergzand suggested: Just maintain a single OpenOCD ABI version field that is stored in ROM and that gets incremented when we make changes that break the OpenOCD ABI. That would have the advantage that OpenOCD would still work with old RIOT versions before this change and future changes would be easier. And it would save ROM. |
Note that this would still require bumping OpenOCD every time we touch thread state names. I wonder if we could move |
OpenOCD could just not show the names, only the numbers, if it detects a RIOT version that is too new. |
There can be years of latency between a change in the RIOT state names, and an OpenOCD landing in the oldest still supported Ubuntu LTS version most people seem to use these days... And memorizing state numbers in the meantime is bit of a pita :) |
I think a version marker still makes sense. |
I could add a version marker, but it would not be put to use as of now. If the state names could indeed go into the debug section and would never be flashed to the device, I see no reason to restrict adding them to |
Contribution description
This provides the thread state names as used in ps() as a symbol that OpenOCD can read out. This allows implementing OpenOCD's RIOT awareness in a way that changes to thread states can be picked up at runtime, without having to patch OpenOCD for every change. Apparently RIOT is a bit faster moving in this regard than other bare metal RTOSes.
Testing procedure
ps()
should still work as before. In addition, OpenOCD with the patch at https://review.openocd.org/c/openocd/+/7133 should now display thread states with the exact spelling as inps()
(or shell comamndps
), while the built-in thread state name lookup table is used for RIOT prior to this commit.Issues/PRs references
Useful for #18454 which will break OpenOCD's RIOT-awareness. With this, at least future thread state changes should no longer require patching OpenOCD.