Skip to main content

LinuxPlatform

Struct LinuxPlatform 

Source
pub struct LinuxPlatform { /* private fields */ }
Expand description

The Linux implementation of Platform.

Implementations§

Source§

impl LinuxPlatform

Source

pub fn new() -> Self

Source

pub fn with_sysfs(sysfs: Sysfs) -> Self

Read topology from an alternate filesystem root. Used by tests and by the hidden --sysroot flag for inspecting a captured tree.

Trait Implementations§

Source§

impl Default for LinuxPlatform

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Platform for LinuxPlatform

Source§

fn name(&self) -> &'static str

Human-readable backend name, e.g. "linux".
Source§

fn discover_topology(&self) -> Result<Topology>

Discover the full machine topology.
Source§

fn pin_current_thread(&self, cpu: LogicalId) -> Result<()>

Restrict the calling thread to a single logical CPU. Read more
Source§

fn set_current_thread_affinity(&self, cpus: &CpuSet) -> Result<()>

Set the calling thread’s affinity to an arbitrary set.
Source§

fn current_thread_affinity(&self) -> Result<CpuSet>

Read the calling thread’s current affinity mask.
Source§

fn process_affinity(&self) -> Result<CpuSet>

Read the affinity mask of the whole process.
Source§

fn thread_switch_counters(&self) -> Option<SwitchCounters>

Sample the calling thread’s context-switch counters, when the platform can report them per-thread. None means “no interference data”, and callers degrade to statistical outlier detection alone.
Source§

fn spawn_with_affinity( &self, command: &mut Command, cpus: &CpuSet, ) -> Result<Child>

Spawn a child process confined to cpus. Read more
Source§

fn thread_cycles(&self) -> Option<u64>

Cycles the calling thread has actually been executing. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.