Struct linux_taskstats::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Interface to access kernel taskstats API through the netlink socket.

Implementations§

source§

impl Client

source

pub fn open() -> Result<Self>

Open netlink socket against kernel and create a new instance of Client

§Errors
  • when netlink socket initialization failed
  • when kernel doesn’t offer family id for taskstats
source

pub fn pid_stats(&self, tid: u32) -> Result<TaskStats>

Obtain taskstats for given task ID (e.g. single thread of a multithreaded process)

§Arguments
  • tid - Kernel task ID (“pid”, “tid” and “task” are used interchangeably and refer to the standard Linux task defined by struct task_struct)
§Return
  • TaskStats storing the target task’s stats
§Errors
  • when netlink socket failed
  • when kernel responded error
  • when the returned data couldn’t be interpreted
source

pub fn tgid_stats(&self, tgid: u32) -> Result<TaskStats>

Obtain taskstats for given thread group ID (e.g. cumulated statistics of a multithreaded process)

§Arguments
  • tgid - Kernel thread group ID (“tgid”, “process” and “thread group” are used interchangeably and refer to the traditional Unix process)
§Return
  • TaskStats storing the target thread group’s aggregated stats
§Errors
  • when netlink socket failed
  • when kernel responded error
  • when the returned data couldn’t be interpreted

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.