-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add support for additional DWT counters #349
Conversation
This adds support for these counters: * CPI counter * Exception overhead counter * LSU counter * Folded-instruction counter
r? @therealprof (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -62,7 +62,56 @@ pub struct Comparator { | |||
reserved: u32, | |||
} | |||
|
|||
// DWT CTRL register fields |
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 might be worth trying to add a link to the Arm Armv7-M ARM here, to explain where the constants came from.
I think I'd like to see a |
I am happy to do that too. This is a debug feature, the crate is still pre-1.0, and it is a minor change, so I don't think the impact will be significant. Is it ok to make that change within this pull-request? That is marking |
I'll defer to someone like @therealprof or @adamgreig on that one. |
Our policy is to make a minor release for breaking changes while <1.0 (per standard Rust semver), so I'm happy to deprecate |
This follows the rust C-GETTER API guidelines.
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.
Thanks! This all LGTM, but could you update the changelog to reflect the deprecation of get_cycle_count()
? Happy to merge after that.
Whoops, good catch, thanks! I updated the changelog. |
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.
Thanks!
bors merge
Build succeeded: |
375: Prepare v0.7.4 r=thejpster a=adamgreig I've created a new branch, `v0.7.x`, which is currently at the latest non-breaking commit (so includes #346 #349 #347 #351 #339 #352 #348 #363 #362 #361 but does not include #342), to track the 0.7 series since master now contains breaking changes for v0.8. This PR (which targets the new branch) cherry-picks #372 #369 #374 and bumps the version to v0.7.4 (and updates CHANGELOG) ready for a new v0.7.4 release. Once complete I'll also backport the changelog entries and bump the version in master to 0.7.4. I think this is everything that should be in 0.7 -- the only excluded PRs from master are #342 and #367 I believe, and I don't think we have any open PRs targeting 0.7 either. Any other thoughts on items for inclusion in 0.7.4 (or other changelog entries I missed)? Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Adam Greig <[email protected]>
This adds support for these DWT counters:
The getters do not have the
get_
prefix per the C-GETTER API guidelines. This does not match the existingget_cycle_count
method. I was not sure if I should maintain consistency or not, let me know if you want this changed.Here is the documentation to validate each of the added methods:
num_comp
num_comp
method is not guarded with#[cfg(not(armv6m))]
because it is valid for both.has_exception_trace
has_external_match
has_cycle_counter
has_profiling_counter
disable_cycle_counter
cycle_counter_enabled
cpi_count
set_cpi_count
exception_count
set_exception_count
sleep_count
set_sleep_count
lsu_count
set_lsu_count
fold_count
set_fold_count