-
Notifications
You must be signed in to change notification settings - Fork 307
Add embassy executor cpu stats #3728
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
base: main
Are you sure you want to change the base?
Conversation
esp-hal-embassy/Cargo.toml
Outdated
@@ -21,7 +21,7 @@ test = false | |||
[dependencies] | |||
cfg-if = "1.0.0" | |||
critical-section = "1.2.0" | |||
esp-hal = { version = "1.0.0-beta.1", path = "../esp-hal" } | |||
esp-hal = { version = "1.0.0-beta.1", path = "../esp-hal", features = ["unstable"] } |
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.
esp-hal = { version = "1.0.0-beta.1", path = "../esp-hal", features = ["unstable"] } | |
esp-hal = { version = "1.0.0-beta.1", path = "../esp-hal" } |
We intentionally don't enable the feature.
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.
Without it it doesn't compile standalone. If that is intentional I will disable it
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.
You need to enable unstable
in your own project, not like this.
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.
done
As #3737 is merged do you wish to redo this PR as an example using hooking into executor? I would still be beneficial to have something like that visable for new devs |
Sure, why not? rtos-trace is a bit better tool to gather usage stats in general, but this would still be a fine example. A few notes:
|
…assy_executor_cpu_stats
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Added CPU usage measurements via Embassy executor using the
low_power_wait
featureDescription
Based on this PR: embassy-rs/embassy#3920, added the same functionality internally (not as an example). Also added it to the new YAML-based config, but couldn't find a way for the config to check if the required
low_power_wait
feature is enabled, as none of the existing validators (negative_integer
,non_negative_integer
,positive_integer
,integer_in_range
,enumeration
) are suitable for this.Testing
Used it to debug an issue with bad UART communication, because CPU was fully being utilised by another part of the program.