#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pid: i32task_struct.pid. The kernel’s per-task identifier.
tgid: i32task_struct.tgid. Thread-group identifier (POSIX getpid()).
comm: Stringtask_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: u32task_struct.scx.weight (u32). scx-domain CFS-equivalent
weight; 100 default.
prio: i32task_struct.prio. Effective scheduling priority
(PI-boost-aware).
static_prio: i32task_struct.static_prio. User-set priority before PI boost.
normal_prio: i32task_struct.normal_prio. Normal priority for the class.
rt_priority: u32task_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).
task_struct.core_cookie (unsigned long).
CONFIG_SCHED_CORE-gated; None on kernels built without it.
pi_boosted_out_of_scx: boolTrue 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: u64task_struct.nvcsw (unsigned long). Voluntary context
switches for this live thread.
nivcsw: u64task_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: u64task_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: u64task_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
impl Clone for TaskEnrichment
Source§fn clone(&self) -> TaskEnrichment
fn clone(&self) -> TaskEnrichment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskEnrichment
impl Debug for TaskEnrichment
Source§impl Default for TaskEnrichment
impl Default for TaskEnrichment
Source§fn default() -> TaskEnrichment
fn default() -> TaskEnrichment
Source§impl<'de> Deserialize<'de> for TaskEnrichment
impl<'de> Deserialize<'de> for TaskEnrichment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TaskEnrichment
impl RefUnwindSafe for TaskEnrichment
impl Send for TaskEnrichment
impl Sync for TaskEnrichment
impl Unpin for TaskEnrichment
impl UnwindSafe for TaskEnrichment
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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