Skip to main content

Stable

Struct Stable 

Source
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: u32

Login 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: u32

Process 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: i64

The 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: bool

Whether 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: bool

Trait Implementations§

Source§

impl Clone for Stable

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Stable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Stable

Source§

fn default() -> Self

Returns the “default value” for a type. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.