Skip to content

Commit

Permalink
fix: 验证频率警告更有意义
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow3aaa committed Mar 2, 2025
1 parent 8c01f82 commit d089e07
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cpu_common/cpu_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ impl Info {
let min_acceptable_freq = self
.freqs
.iter()
.take_while(|freq| **freq < current_freq)
.take_while(|freq| **freq <= verify_freq)
.last()
.copied()
.unwrap_or(current_freq);
.unwrap_or(verify_freq);
let max_acceptable_freq = self
.freqs
.iter()
.find(|freq| **freq > current_freq)
.find(|freq| **freq >= verify_freq)
.copied()
.unwrap_or(current_freq);
if !(min_acceptable_freq..=max_acceptable_freq).contains(&verify_freq) {
.unwrap_or(verify_freq);
if !(min_acceptable_freq..=max_acceptable_freq).contains(&current_freq) {
warn!(
"CPU Policy{}: Frequency control does not meet expectations! Expected: {}-{}, Actual: {}",
self.policy, min_acceptable_freq, max_acceptable_freq, verify_freq
self.policy, min_acceptable_freq, max_acceptable_freq, current_freq
);
}
}
Expand Down

0 comments on commit d089e07

Please sign in to comment.