Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions rust/scx_utils/src/energy_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::fmt;
use std::path::Path;
use std::sync::Arc;

#[derive(Debug, Clone, Eq, Hash, Ord, PartialOrd)]
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PerfState {
pub cost: usize,
pub frequency: usize,
Expand All @@ -33,7 +33,7 @@ pub struct PerfState {
pub power: usize,
}

#[derive(Debug, Clone, Eq, Hash, Ord, PartialOrd)]
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PerfDomain {
/// Monotonically increasing unique id.
pub id: usize,
Expand Down Expand Up @@ -130,12 +130,6 @@ impl PerfDomain {
}
}

impl PartialEq for PerfDomain {
fn eq(&self, other: &Self) -> bool {
self.id == other.id && self.span == other.span && self.perf_table == other.perf_table
}
}

impl PerfState {
/// Build a PerfState
pub fn new(root: String) -> Result<PerfState> {
Expand All @@ -155,15 +149,6 @@ impl PerfState {
}
}

impl PartialEq for PerfState {
fn eq(&self, other: &Self) -> bool {
self.cost == other.cost
&& self.frequency == other.frequency
&& self.performance == other.performance
&& self.power == other.power
}
}

impl fmt::Display for EnergyModel {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for (_, pd) in self.perf_doms.iter() {
Expand Down