-
Notifications
You must be signed in to change notification settings - Fork 98
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
Benchmarking embedded rust code #669
Comments
For cortex-m devices, the ITM can be used to do this if your microcontroller can support it. probe-rs supports this functionality via the CLI or via your own custom code. Probe-rs's CLI has a Take a look at rtic-scope if you're using RTIC |
An approach has been mentioned in https://blog.japaric.io/rtfm-overhead/. I've been also using the external method using a GPIO quite successfully to do A/B comparisons of code and optimize it, though it won't yield exact measurements. There have been some experiments with https://github.com/orbcode/orbuculum a long time ago but I can't find any reference. Using that software with ITM/ETM has the potential of yielding professional level results and details at the expense of a non-trivial setup and potentially research work. |
Closing this as part of the 2024 triage. I'd definitely recommend following up with If anyone discovers this in the future or has a better solution - please feel free to submit it to the https://github.com/rust-embedded/awesome-embedded-rust list! |
I've been working on my own embedded rust project (a no_std KYBER implementation), and have been trying to run time consistency tests on my micro-controller. As such, I'm currently trying to validate that the number of clock cycles are constant for each of my critical functions, and I can measure the clock cycle time directly through cortex_m::Peripherals
However, I can't find any bench-marking framework which supports measuring this, or even any projects that take measurements (be they clock or real-world time) of a micro-controller's runtime.
As such, are there any good libraries/examples on profiling execution time on a micro-controller, and if not, are there any examples on how to write your own bench-marking framework for an embedded system?
The text was updated successfully, but these errors were encountered: