CtprofDiff

Struct CtprofDiff 

Source
#[non_exhaustive]
pub struct CtprofDiff {
Show 14 fields pub sort_metric_name: Option<&'static str>, pub rows: Vec<DiffRow>, pub only_baseline: Vec<String>, pub only_candidate: Vec<String>, pub fudged_pairs: Vec<FudgedPair>, pub cgroup_stats_a: BTreeMap<String, CgroupStats>, pub cgroup_stats_b: BTreeMap<String, CgroupStats>, pub host_psi_a: Psi, pub host_psi_b: Psi, pub smaps_rollup_a: BTreeMap<String, BTreeMap<String, u64>>, pub smaps_rollup_b: BTreeMap<String, BTreeMap<String, u64>>, pub sched_ext_a: Option<SchedExtSysfs>, pub sched_ext_b: Option<SchedExtSysfs>, pub derived_rows: Vec<DerivedRow>,
}
Expand description

Full comparison result.

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.
§sort_metric_name: Option<&'static str>§rows: Vec<DiffRow>§only_baseline: Vec<String>

Group keys that appeared in the baseline snapshot but not in the candidate, AFTER fudging removes pairs that joined via thread-population overlap. Post-fudge survivors only — keys that were rejoined to a candidate counterpart move into Self::fudged_pairs and drop out of this list.

§only_candidate: Vec<String>

Group keys that appeared in the candidate snapshot but not in the baseline, AFTER fudging. Post-fudge survivors only; same semantics as Self::only_baseline for the candidate side.

§fudged_pairs: Vec<FudgedPair>

Cgroup pairs joined together via thread-population overlap (Jaccard ≥ 0.90 over (pcomm, comm) thread-type sets). Each entry is one matched (baseline, candidate) cgroup pair plus its overlap / Jaccard / residuals / cascade metadata. Pairs are emitted by the fudge stage of super::compare() and consumed by the renderer’s “Fudged cgroup matches” section. Empty except under super::GroupBy::All (fudge runs only when group_by == GroupBy::All, matching on the cgroup prefix of each compound key).

§cgroup_stats_a: BTreeMap<String, CgroupStats>

Baseline-only cgroup-level enrichment rows, keyed by the cgroup path (after flatten). Populated only for super::GroupBy::Cgroup.

§cgroup_stats_b: BTreeMap<String, CgroupStats>

Candidate-only cgroup-level enrichment rows, same shape.

§host_psi_a: Psi

Baseline host-level Pressure Stall Information snapshot. Always populated (independent of super::GroupBy) — host-level PSI surfaces above the per-thread table for any compare, not just cgroup-grouped ones.

§host_psi_b: Psi

Candidate host-level PSI snapshot.

§smaps_rollup_a: BTreeMap<String, BTreeMap<String, u64>>

Baseline per-process smaps_rollup maps. Default normalization keys by the token-normalized pcomm (pattern_key(&t.pcomm)) — ephemeral PIDs across snapshots collapse into one bucket per pcomm pattern (e.g. worker-{N}), and the tgid is intentionally NOT part of the key (every PID for a given pcomm pattern shares a bucket; per-field byte counts SUM at super::collect_smaps_rollup when multiple PIDs collapse). Keys match the primary-table Pcomm group keys WHEN ≥2 processes share the same pattern (firefox, kworker/{N}:{N}, worker-{N}, …). Singleton digit pcomms diverge intentionally: the primary table reverts the bucket key to the literal pcomm (e.g. worker-7) when only one process matches the skeleton — see super::build_groups’s singleton-revert gate — while smaps stays normalized (worker-{N}) regardless of bucket size, so cross-snapshot rows still join when PIDs are ephemeral. The asymmetry is documented on super::collect_smaps_rollup and is load-bearing for memory-leak diffing across reboots; correlation between the smaps row and the primary table happens via the shared pcomm pattern, not always via byte-identical keys.

With super::CompareOptions::no_thread_normalize set, keys preserve the literal pcomm[tgid] shape so each PID stays attributable to its specific process instance — the [tgid] is preserved precisely so two distinct PIDs sharing a pcomm don’t collide within a snapshot. Rows only join across snapshots when the same process instance ran on both sides, which is the price of literal mode.

Populated from the per-thread leader rows of the snapshot (tid == tgid; see crate::ctprof::ThreadState::smaps_rollup_kib).

§smaps_rollup_b: BTreeMap<String, BTreeMap<String, u64>>

Candidate per-process smaps_rollup maps, same shape and normalization rules as Self::smaps_rollup_a.

§sched_ext_a: Option<SchedExtSysfs>

Baseline global sched_ext sysfs snapshot. None when the baseline kernel had no /sys/kernel/sched_ext/ directory (CONFIG_SCHED_CLASS_EXT=n build).

§sched_ext_b: Option<SchedExtSysfs>

Candidate global sched_ext sysfs snapshot, same shape.

§derived_rows: Vec<DerivedRow>

One row per (matched group, derived metric) pair. Each derivation in super::CTPROF_DERIVED_METRICS consumes already-aggregated input metrics from the group’s metrics map (see ThreadGroup::metrics) and produces a scalar f64 with its own unit. None-valued sides signal “not computable” — either the input metric was missing on that side (capture-time CONFIG gate not set, jemalloc not linked) or the formula’s denominator was zero. Surfaced by super::write_diff in the dedicated ## Derived metrics section after the main table.

Trait Implementations§

Source§

impl Clone for CtprofDiff

Source§

fn clone(&self) -> CtprofDiff

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 CtprofDiff

Source§

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

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

impl Default for CtprofDiff

Source§

fn default() -> CtprofDiff

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.

§

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
§

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

§

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