8000 ProcessStandard: Make debugging data optional by bradjc · Pull Request #4188 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ProcessStandard: Make debugging data optional #4188

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

Merged
merged 7 commits into from
Oct 20, 2024
Merged

Conversation

bradjc
Copy link
Contributor
@bradjc bradjc commented Oct 2, 2024

Pull Request Overview

Currently the ProcessStandard struct contains fields for debugging information. This leads to a tension: what is the right amount of debugging data to store? What if some kernels want to track more and others less? This attempts to shrink the size of the ProcessStandard object for kernels that may care about that.

This PR makes the debugging information for ProcessStandard only accessible via a trait. Different kernels can use different implementations for that trait which may or may not store debugging information.

By default we continue to use the full debugging information for any board that calls the load_processes functions. Boards that use the async process loader can choose via the component which debug implementation they use.

Testing Strategy

Compiling.

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

I added some more comments to process_standard.rs to give some context for what the D parameter is.

Formatting

  • Ran make prepush.

@bradjc bradjc marked this pull request as ready for review October 2, 2024 19:57
@alevy
Copy link
Member
alevy commented Oct 3, 2024

This generally looks like a positive change to me, though I think it might either need at least one example, or better documentation somewhere to guide people towards using ().

bradjc added 2 commits October 7, 2024 14:04
Can use the `()` type for no debugging.
Only need the custom default for the map cell, not the inner type.
@bradjc
Copy link
Contributor Author
bradjc commented Oct 7, 2024

I added another sentence, but, this is somewhat hard to document. We don't have a board that doesn't use the debugging, and I'm not sure this is important enough to add one as an example.

Unfortunately the type is passed through macros and is pretty disconnected from what it does. If you are thinking about this (and want to disable debugging) I think it is pretty straightforward to use, but if you are just reading the code it's not clear why a storage permissions policy needs a process debug type.

@bradjc bradjc requested a review from lschuermann October 9, 2024 16:08
@bradjc
Copy link
Contributor Author
bradjc commented Oct 9, 2024

@lschuermann I know we talked about this for a while. I don't remember anymore what the next step seemed to be, but this still seems like a step in the right direction to enable smaller RAM kernels.

Copy link
Member
@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in getting to this! This looks good.

I tried to go one step further than this and remove the various ProcessStandard specific debug hooks from the core kernel in favor of a more general abstraction. Unfortunately, doing this transformation meant that we'd either have a massive amount of dynamic dispatch or type parameters everywhere in the kernel. I want to revisit these efforts at some point in the future, but this is a step in the right direction.

I don't have any thoughts about the "discoverability" of this PR. I agree that having this be a somewhat un-/under-documented option is not great, but for anyone who's deep down the rabbit hole of optimizing Tock's size / performance, I hope this should be sufficiently apparent.

@lschuermann lschuermann added the last-call Final review period for a pull request. label Oct 18, 2024
@lschuermann lschuermann added this pull request to the merge queue Oct 20, 2024
Merged via the queue into master with commit e2aa263 Oct 20, 2024
18 checks passed
@lschuermann lschuermann deleted the process-debug-shrink branch October 20, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component kernel last-call Final review period for a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0