procfs_core::process

Struct Status

source
#[non_exhaustive]
pub struct Status {
Show 61 fields pub name: String, pub umask: Option<u32>, pub state: String, pub tgid: i32, pub ngid: Option<i32>, pub pid: i32, pub ppid: i32, pub tracerpid: i32, pub ruid: u32, pub euid: u32, pub suid: u32, pub fuid: u32, pub rgid: u32, pub egid: u32, pub sgid: u32, pub fgid: u32, pub fdsize: u32, pub groups: Vec<i32>, pub nstgid: Option<Vec<i32>>, pub nspid: Option<Vec<i32>>, pub nspgid: Option<Vec<i32>>, pub nssid: Option<Vec<i32>>, pub vmpeak: Option<u64>, pub vmsize: Option<u64>, pub vmlck: Option<u64>, pub vmpin: Option<u64>, pub vmhwm: Option<u64>, pub vmrss: Option<u64>, pub rssanon: Option<u64>, pub rssfile: Option<u64>, pub rssshmem: Option<u64>, pub vmdata: Option<u64>, pub vmstk: Option<u64>, pub vmexe: Option<u64>, pub vmlib: Option<u64>, pub vmpte: Option<u64>, pub vmswap: Option<u64>, pub hugetlbpages: Option<u64>, pub threads: u64, pub sigq: (u64, u64), pub sigpnd: u64, pub shdpnd: u64, pub sigblk: u64, pub sigign: u64, pub sigcgt: u64, pub capinh: u64, pub capprm: u64, pub capeff: u64, pub capbnd: Option<u64>, pub capamb: Option<u64>, pub nonewprivs: Option<u64>, pub seccomp: Option<u32>, pub speculation_store_bypass: Option<String>, pub cpus_allowed: Option<Vec<u32>>, pub cpus_allowed_list: Option<Vec<(u32, u32)>>, pub mems_allowed: Option<Vec<u32>>, pub mems_allowed_list: Option<Vec<(u32, u32)>>, pub voluntary_ctxt_switches: Option<u64>, pub nonvoluntary_ctxt_switches: Option<u64>, pub core_dumping: Option<bool>, pub thp_enabled: Option<bool>,
}
Expand description

Status information about the process, based on the /proc/<pid>/status file.

Not all fields are available in every kernel. These fields have Option<T> types. In general, the current kernel version will tell you what fields you can expect, but this isn’t totally reliable, since some kernels might backport certain fields, or fields might only be present if certain kernel configuration options are enabled. Be prepared to handle None values.

New fields to this struct may be added at any time (even without a major or minor semver bump).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Command run by this process.

§umask: Option<u32>

Process umask, expressed in octal with a leading zero; see umask(2). (Since Linux 4.7.)

§state: String

Current state of the process.

§tgid: i32

Thread group ID (i.e., Process ID).

§ngid: Option<i32>

NUMA group ID (0 if none; since Linux 3.13).

§pid: i32

Thread ID (see gettid(2)).

§ppid: i32

PID of parent process.

§tracerpid: i32

PID of process tracing this process (0 if not being traced).

§ruid: u32

Real UID.

§euid: u32

Effective UID.

§suid: u32

Saved set UID.

§fuid: u32

Filesystem UID.

§rgid: u32

Real GID.

§egid: u32

Effective GID.

§sgid: u32

Saved set GID.

§fgid: u32

Filesystem GID.

§fdsize: u32

Number of file descriptor slots currently allocated.

§groups: Vec<i32>

Supplementary group list.

§nstgid: Option<Vec<i32>>

Thread group ID (i.e., PID) in each of the PID namespaces of which (pid)[struct.Status.html#structfield.pid] is a member. The leftmost entry shows the value with respect to the PID namespace of the reading process, followed by the value in successively nested inner namespaces. (Since Linux 4.1.)

§nspid: Option<Vec<i32>>

Thread ID in each of the PID namespaces of which (pid)[struct.Status.html#structfield.pid] is a member. The fields are ordered as for NStgid. (Since Linux 4.1.)

§nspgid: Option<Vec<i32>>

Process group ID in each of the PID namespaces of which (pid)[struct.Status.html#structfield.pid] is a member. The fields are ordered as for NStgid. (Since Linux 4.1.)

§nssid: Option<Vec<i32>>

NSsid: descendant namespace session ID hierarchy Session ID in each of the PID namespaces of which (pid)[struct.Status.html#structfield.pid] is a member. The fields are ordered as for NStgid. (Since Linux 4.1.)

§vmpeak: Option<u64>

Peak virtual memory size by kibibytes.

§vmsize: Option<u64>

Virtual memory size by kibibytes.

§vmlck: Option<u64>

Locked memory size by kibibytes (see mlock(3)).

§vmpin: Option<u64>

Pinned memory size by kibibytes (since Linux 3.2). These are pages that can’t be moved because something needs to directly access physical memory.

§vmhwm: Option<u64>

Peak resident set size by kibibytes (“high water mark”).

§vmrss: Option<u64>

Resident set size by kibibytes. Note that the value here is the sum of RssAnon, RssFile, and RssShmem.

§rssanon: Option<u64>

Size of resident anonymous memory by kibibytes. (since Linux 4.5).

§rssfile: Option<u64>

Size of resident file mappings by kibibytes. (since Linux 4.5).

§rssshmem: Option<u64>

Size of resident shared memory by kibibytes (includes System V shared memory, mappings from tmpfs(5), and shared anonymous mappings). (since Linux 4.5).

§vmdata: Option<u64>

Size of data by kibibytes.

§vmstk: Option<u64>

Size of stack by kibibytes.

§vmexe: Option<u64>

Size of text seg‐ments by kibibytes.

§vmlib: Option<u64>

Shared library code size by kibibytes.

§vmpte: Option<u64>

Page table entries size by kibibytes (since Linux 2.6.10).

§vmswap: Option<u64>

Swapped-out virtual memory size by anonymous private pages by kibibytes; shmem swap usage is not included (since Linux 2.6.34).

§hugetlbpages: Option<u64>

Size of hugetlb memory portions by kB. (since Linux 4.4).

§threads: u64

Number of threads in process containing this thread.

§sigq: (u64, u64)

This field contains two slash-separated numbers that relate to queued signals for the real user ID of this process. The first of these is the number of currently queued signals for this real user ID, and the second is the resource limit on the number of queued signals for this process (see the description of RLIMIT_SIGPENDING in getrlimit(2)).

§sigpnd: u64

Number of signals pending for thread (see pthreads(7) and signal(7)).

§shdpnd: u64

Number of signals pending for process as a whole (see pthreads(7) and signal(7)).

§sigblk: u64

Masks indicating signals being blocked (see signal(7)).

§sigign: u64

Masks indicating signals being ignored (see signal(7)).

§sigcgt: u64

Masks indicating signals being caught (see signal(7)).

§capinh: u64

Masks of capabilities enabled in inheritable sets (see capabilities(7)).

§capprm: u64

Masks of capabilities enabled in permitted sets (see capabilities(7)).

§capeff: u64

Masks of capabilities enabled in effective sets (see capabilities(7)).

§capbnd: Option<u64>

Capability Bounding set (since Linux 2.6.26, see capabilities(7)).

§capamb: Option<u64>

Ambient capability set (since Linux 4.3, see capabilities(7)).

§nonewprivs: Option<u64>

Value of the no_new_privs bit (since Linux 4.10, see prctl(2)).

§seccomp: Option<u32>

Seccomp mode of the process (since Linux 3.8, see seccomp(2)). 0 means SECCOMP_MODE_DISABLED; 1 means SEC‐ COMP_MODE_STRICT; 2 means SECCOMP_MODE_FILTER. This field is provided only if the kernel was built with the CON‐ FIG_SECCOMP kernel configuration option enabled.

§speculation_store_bypass: Option<String>

Speculative store bypass mitigation status.

§cpus_allowed: Option<Vec<u32>>

Mask of CPUs on which this process may run (since Linux 2.6.24, see cpuset(7)).

§cpus_allowed_list: Option<Vec<(u32, u32)>>

Same as previous, but in “list format” (since Linux 2.6.26, see cpuset(7)).

§mems_allowed: Option<Vec<u32>>

Mask of memory nodes allowed to this process (since Linux 2.6.24, see cpuset(7)).

§mems_allowed_list: Option<Vec<(u32, u32)>>

Same as previous, but in “list format” (since Linux 2.6.26, see cpuset(7)).

§voluntary_ctxt_switches: Option<u64>

Number of voluntary context switches (since Linux 2.6.23).

§nonvoluntary_ctxt_switches: Option<u64>

Number of involuntary context switches (since Linux 2.6.23).

§core_dumping: Option<bool>

Contains true if the process is currently dumping core.

This information can be used by a monitoring process to avoid killing a processing that is currently dumping core, which could result in a corrupted core dump file.

(Since Linux 4.15)

§thp_enabled: Option<bool>

Contains true if the process is allowed to use THP

(Since Linux 5.0)

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

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

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

impl<'de> Deserialize<'de> for Status

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromBufRead for Status

source§

fn from_buf_read<R: BufRead>(reader: R) -> ProcResult<Self>

source§

impl Serialize for Status

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRead for T
where T: FromBufRead,

source§

fn from_read<R>(r: R) -> Result<T, ProcError>
where R: Read,

Read the type from a Read.
source§

fn from_file<P: AsRef<Path>>(path: P) -> ProcResult<Self>

Read the type from a file.
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> 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 = 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>,

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,