#[repr(C)]pub struct Rusage {}Expand description
资源使用情况结构体(对应 C 的 struct rusage)
记录进程或线程的时间和资源消耗信息
MUSL: https://github.com/bminor/musl/blob/c47ad25ea3b484e10326f933e927c0bc8cded3da/include/sys/resource.h#L27
Fields§
§utime: TimeVal用户态运行时间(单位:秒 + 微秒)
stime: TimeVal内核态运行时间(单位:秒 + 微秒)
maxrss: i64最大常驻集大小(单位:KB),即内存占用峰值
ixrss: i64索引页的使用数量(已废弃)
idrss: i64数据段内存使用量(已废弃)
isrss: i64堆栈段内存使用量(已废弃)
minflt: i64页面缺页异常数(软缺页,不涉及磁盘 IO)
majflt: i64主缺页异常数(硬缺页,需要从磁盘读取页面)
nswap: i64发生的交换(swap)次数
inblock: i64输入操作(块设备读取)的次数
oublock: i64输出操作(块设备写入)的次数
msgsnd: i64发送的 IPC 消息数(已废弃)
msgrcv: i64接收的 IPC 消息数(已废弃)
nsignals: i64捕获的信号数量
nvcsw: i64自愿上下文切换次数(如等待锁)
nivcsw: i64非自愿上下文切换次数(被内核抢占)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rusage
impl RefUnwindSafe for Rusage
impl Send for Rusage
impl Sync for Rusage
impl Unpin for Rusage
impl UnwindSafe for Rusage
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