-
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
sys/shell: reduce overhead of XFA shell commands #20958
base: master
Are you sure you want to change the base?
Conversation
Ah, I should also show that this does actually bring down This PR:
And in
|
Murdock results❌ FAILED 55a1a7a DROPME: fix build with rust
Build failures (1)
Artifacts |
Interesting: On |
f4b2ef1
to
9434532
Compare
9434532
to
c9240ac
Compare
c106c72
to
7ebf793
Compare
XFA_USE_CONST(shell_command_xfa_t*, shell_commands_xfa); \ | ||
XFA_USE_CONST(shell_command_xfa_t, shell_commands_xfa_v2); \ |
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.
Why do we need to rename this? I would have expected this name to be an implementation detail.
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.
It is an implementation detail, but the implementation of shell XFA is split across two repos: This repo contains the C implementation, https://github.com/RIOT-OS/rust-riot-wrappers contains the rust implementation.
If the rust impl would live here as well, I would have just adapted both in lock-step and kept the symbol name. But with the current state of affair, there is a benefit to be able to implement the rust side in a way that it will work with both variants of RIOT. (E.g. so that we can update the rust side while using a stable release on the C side.) See RIOT-OS/rust-riot-wrappers#134 for why this is beneficial for the rust side.
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.
Alright, thanks for the explanation, makes sense!
This command does the same as `help`, but provides a machine readable JSON rather than a human readable table. It is only provided when the (pseudo-)module `shell_json` is used.
This increases the robustness of the test by not relying on the order shell commands are printed in. At least for XFA based shell commands, there is no guarantee in which order they will be shown in the help.
We do not need to add an array of pointers to the shell commands, just an array of shell commands is sufficient. This reduced the overhead of XFA by `sizeof(void *)` per command.
7ebf793
to
55a1a7a
Compare
Contribution description
We do not need to add an array of pointers to the shell commands, just an array of shell commands is sufficient. This reduced the overhead of XFA by
sizeof(void *)
per command.Testing procedure
And
native
will be tested by the CI.Issues/PRs references