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
impl Client
sourcepub fn open() -> Result<Self>
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
sourcepub fn pid_stats(&self, tid: u32) -> Result<TaskStats>
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
sourcepub fn tgid_stats(&self, tgid: u32) -> Result<TaskStats>
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§
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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
Mutably borrows from an owned value. Read more