pub struct Stable {Show 13 fields
pub uid: u32,
pub cmdline: Option<Box<str>>,
pub exe: Option<Box<str>>,
pub cwd: Option<Box<str>>,
pub session: u32,
pub pgrp: u32,
pub tpgid: i64,
pub tty_dev: i64,
pub exe_deleted: bool,
pub cgroup: Option<Box<str>>,
pub container: Option<Box<str>>,
pub container_runtime: Option<Box<str>>,
pub is_kernel_thread: bool,
}Expand description
The cached identity of one process.
Fields§
§uid: u32§cmdline: Option<Box<str>>§exe: Option<Box<str>>§cwd: Option<Box<str>>The process’s working directory.
Cached alongside exe rather than read per sample: it costs a readlink
per process, and it is display-only — nothing sorts or filters on it by
default. The cost is one syscall per process per lifetime, not per tick.
session: u32Login session id.
Cached because it needs a syscall of its own (getsid) on macOS, where
proc_bsdinfo does not carry it. Linux reads it from field 4 of
/proc/<pid>/stat, which the scan already has, so its value does not come
from here — but keeping one field for both platforms means the two backends
cannot drift in what SESSION means.
0 is “unknown”, which is what getsid yields for another user’s process
(EPERM). It renders -.
pgrp: u32Process group and the terminal’s foreground group, so a thread row can inherit them instead of re-asking the kernel per thread.
tpgid is -1 when the terminal has no foreground job.
tpgid: i64§tty_dev: i64The controlling terminal’s device, in the platform’s own encoding.
Linux leaves this 0 because tty_nr arrives in the stat the scan
already parses; macOS fills it from e_tdev, since proc_bsdinfo is a
separate call per process and the thread pass should not repeat it.
exe_deleted: boolWhether the executable has been replaced or deleted on disk.
Linux exposes this in the /proc/<pid>/exe symlink target itself: once the
file backing a running process is unlinked or replaced, the kernel appends
(deleted) to the target. That is the only signal available — comparing
mtimes would need the path to still exist, which is exactly what deleting
it removes.
Cached with the identity because the flag cannot change without the process’s exe being replaced, and re-reading the link per frame would be thousands of syscalls a second for a value that almost never changes.
cgroup: Option<Box<str>>The cgroup path, not the raw /proc/<pid>/cgroup line.
container: Option<Box<str>>The container’s id, and the runtime that owns it.
Cached here rather than recomputed per frame: classification is a few
finds over a path, which is cheap once per process and wasteful
thousands of times per second.
container_runtime: Option<Box<str>>§is_kernel_thread: boolTrait Implementations§
Auto Trait Implementations§
impl Freeze for Stable
impl RefUnwindSafe for Stable
impl Send for Stable
impl Sync for Stable
impl Unpin for Stable
impl UnsafeUnpin for Stable
impl UnwindSafe for Stable
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