pub struct KernelState {
pub state: String,
pub ops: Option<String>,
}Fields§
§state: StringContents of state: “enabled”, “disabled”, or a transitional value
(“enabling”/“disabling”) if we catch a switch mid-flight.
ops: Option<String>BPF ops name from root/ops when a scheduler is attached — the name
the scheduler registered with, typically without the scx_ prefix
(e.g. “lavd” for scx_lavd).
Implementations§
Source§impl KernelState
impl KernelState
pub fn enabled(&self) -> bool
Sourcepub fn matches(&self, sched_name: &str) -> bool
pub fn matches(&self, sched_name: &str) -> bool
Whether sched_name (full name, e.g. scx_lavd) plausibly matches
the ops the kernel reports. Ops names are chosen by each scheduler
and some embed extra detail, with or without the scx_ prefix —
bpfland registers e.g. bpfland_1.1.2_x86_64_unknown_linux_gnu,
flow registers scx_flow_3.1.1_x86_64_unknown_linux_gnu — so
beyond an exact match (with or without the prefix) an ops name
that starts with either form of the scheduler name followed by
_ also counts. Used for a soft warning only, so a rare false
negative is acceptable.
Trait Implementations§
Source§impl Clone for KernelState
impl Clone for KernelState
Source§impl Debug for KernelState
impl Debug for KernelState
Source§impl PartialEq for KernelState
impl PartialEq for KernelState
impl StructuralPartialEq for KernelState
Auto Trait Implementations§
impl Freeze for KernelState
impl RefUnwindSafe for KernelState
impl Send for KernelState
impl Sync for KernelState
impl Unpin for KernelState
impl UnsafeUnpin for KernelState
impl UnwindSafe for KernelState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more