mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 03:20:24 +00:00
scx_utils: Add extra ordering macros for topology
Add extra ordering macros for Core/CPU structs for ease of use with Rust standard library features. This issue was hit when trying to sort cores based on the CoreType. See this similar issue for details: https://github.com/rust-lang/rust/issues/113550 Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
parent
a3cc4c223f
commit
a9f3190b5f
@ -68,7 +68,7 @@ use std::ops::BitOrAssign;
|
||||
use std::ops::BitXor;
|
||||
use std::ops::BitXorAssign;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Eq, Clone, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Cpumask {
|
||||
mask: BitVec<u64, Lsb0>,
|
||||
}
|
||||
|
@ -99,13 +99,13 @@ lazy_static::lazy_static! {
|
||||
pub static ref NR_CPUS_POSSIBLE: usize = libbpf_rs::num_possible_cpus().unwrap();
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, Hash, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub enum CoreType {
|
||||
Big { turbo: bool },
|
||||
Little,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Cpu {
|
||||
id: usize,
|
||||
min_freq: usize,
|
||||
@ -163,7 +163,7 @@ impl Cpu {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Core {
|
||||
id: usize,
|
||||
pub node_id: usize,
|
||||
|
Loading…
Reference in New Issue
Block a user