TaskEnrichment

Struct TaskEnrichment 

Source
#[non_exhaustive]
pub struct TaskEnrichment {
Show 26 fields pub pid: i32, pub tgid: i32, pub comm: String, pub group_leader_pid: Option<i32>, pub real_parent_pid: Option<i32>, pub real_parent_comm: Option<String>, pub pgid: Option<i32>, pub sid: Option<i32>, pub nr_threads: Option<i32>, pub weight: u32, pub prio: i32, pub static_prio: i32, pub normal_prio: i32, pub rt_priority: u32, pub sched_class: Option<String>, pub core_cookie: Option<u64>, pub pi_boosted_out_of_scx: bool, pub nvcsw: u64, pub nivcsw: u64, pub signal_nvcsw: Option<u64>, pub signal_nivcsw: Option<u64>, pub utime: u64, pub stime: u64, pub signal_utime: Option<u64>, pub signal_stime: Option<u64>, pub lock_slowpath_match: Option<String>,
}
Expand description

Per-task enrichment captured at freeze time.

Every field is best-effort: read failures (untranslatable RCU pointer, slab-page eviction race, missing BTF field) yield None rather than failing the whole capture. Optional fields cover both “absent on this kernel build” (e.g. core_cookie without CONFIG_SCHED_CORE) and “unreadable at this freeze instant” (e.g. real_parent_pid when the parent task_struct’s slab page didn’t translate).

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.
§pid: i32

task_struct.pid. The kernel’s per-task identifier.

§tgid: i32

task_struct.tgid. Thread-group identifier (POSIX getpid()).

§comm: String

task_struct.comm truncated at the first nul byte.

§group_leader_pid: Option<i32>

task_struct.group_leader->pid. Pointer-followed; None on translate failure or NULL group_leader (init_task case).

§real_parent_pid: Option<i32>

task_struct.real_parent->pid. RCU pointer-followed; None on translate failure or NULL real_parent (init_task).

§real_parent_comm: Option<String>

task_struct.real_parent->comm truncated at the first nul. None if real_parent unreadable.

§pgid: Option<i32>

signal->pids[PIDTYPE_PGID]->numbers[0].nr. Process group id. None on signal_struct translate failure or NULL pids slot.

§sid: Option<i32>

signal->pids[PIDTYPE_SID]->numbers[0].nr. Session id.

§nr_threads: Option<i32>

signal->nr_threads. Live thread count for the thread group. None on signal_struct translate failure.

§weight: u32

task_struct.scx.weight (u32). scx-domain CFS-equivalent weight; 100 default.

§prio: i32

task_struct.prio. Effective scheduling priority (PI-boost-aware).

§static_prio: i32

task_struct.static_prio. User-set priority before PI boost.

§normal_prio: i32

task_struct.normal_prio. Normal priority for the class.

§rt_priority: u32

task_struct.rt_priority. RT priority (1-99) for SCHED_FIFO/RR.

§sched_class: Option<String>

Decoded sched_class name: “fair”, “rt”, “dl”, “idle”, “stop”, or “ext”. None when the pointer matches no cached class (stripped vmlinux or out-of-tree class).

§core_cookie: Option<u64>

task_struct.core_cookie (unsigned long). CONFIG_SCHED_CORE-gated; None on kernels built without it.

§pi_boosted_out_of_scx: bool

True iff the task was on the rq->scx.runnable_list at freeze time AND the ext_sched_class symbol was resolved (classes.ext.is_some()) AND sched_class != ext_sched_class; an unresolved ext symbol leaves the flag false. Indicates the PI boost path moved it out of SCX (rt_mutex_setprio) — failure is not the BPF scheduler’s fault. Set only by the runnable walker; the queued-DSQ walker leaves this false.

§nvcsw: u64

task_struct.nvcsw (unsigned long). Voluntary context switches for this live thread.

§nivcsw: u64

task_struct.nivcsw (unsigned long). Involuntary context switches.

§signal_nvcsw: Option<u64>

signal->nvcsw (unsigned long). Thread-group accumulator for dead threads. None on signal_struct translate failure.

§signal_nivcsw: Option<u64>

signal->nivcsw (unsigned long). Mirror of signal_nvcsw.

§utime: u64

task_struct.utime (u64, nanoseconds). This live thread’s cumulative user-mode CPU time, task-lifetime monotonic. The raw kernel accumulator (NOT the cputime_adjust-scaled /proc value), equal to taskstats ac_utime modulo ns→us truncation. Counter semantics: per-phase user time = end-start delta of the summed-across-tasks reading.

§stime: u64

task_struct.stime (u64, nanoseconds). This live thread’s cumulative system-mode (in-kernel) CPU time — the DSQ-spinlock regression’s direct symptom. Same raw-accumulator / Counter semantics as Self::utime.

§signal_utime: Option<u64>

signal->utime (u64, ns). Thread-group accumulator of EXITED threads’ user-mode CPU time (__exit_signal folds a dying thread’s utime here). None on signal_struct translate failure. Shared across a thread group, so a per-group sum must add it exactly once; combined with the live-thread Self::utime sum it keeps the per-phase total from dipping when a worker exits.

§signal_stime: Option<u64>

signal->stime (u64, ns). Exited threads’ system-mode CPU time accumulator. Mirror of Self::signal_utime.

§lock_slowpath_match: Option<String>

Lock-slowpath pattern matched on a PC supplied by the caller (typically VcpuRegSnapshot.instruction_pointer for the task running on a vCPU at freeze time). One of “queued_spin_lock_slowpath”, “mutex_lock_slowpath”, “rwsem_down_read_slowpath”, “rwsem_down_write_slowpath”, or None when the supplied PC matched nothing OR the caller supplied no PCs.

Set only when walk_task_enrichment is called with a Some(pc) that matches a slowpath window; a None pc always leaves this None. A stack walker that produces multiple PCs (a future kernel-side unwinder) would surface them as a Vec<String> in a non_exhaustive struct extension.

Trait Implementations§

Source§

impl Clone for TaskEnrichment

Source§

fn clone(&self) -> TaskEnrichment

Returns a duplicate 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 TaskEnrichment

Source§

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

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

impl Default for TaskEnrichment

Source§

fn default() -> TaskEnrichment

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TaskEnrichment

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 Serialize for TaskEnrichment

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§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

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

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,