CtprofProbeSummary

Struct CtprofProbeSummary 

Source
#[non_exhaustive]
pub struct CtprofProbeSummary { pub tgids_walked: u64, pub jemalloc_detected: u64, pub probed_ok: u64, pub failed: u64, pub dominant_failure: Option<String>, pub privilege_dominant: bool, }
Expand description

Per-snapshot probe outcome statistics. Curated projection of the capture pipeline’s internal probe tally — exposes the counters, the dominant failure tag, and a privilege_dominant boolean a downstream consumer needs to decide whether the snapshot’s allocated_bytes / deallocated_bytes fields are trustworthy on a given host without parsing the operator- facing tracing line.

The internal probe taxonomy (the per-variant host_thread_probe::AttachError and ProbeError enums) is deliberately NOT mirrored here — it is implementation detail that may change shape without breaking this contract. dominant_failure carries the operator-facing tag string (e.g. "ptrace-seize", "dwarf-parse-failure") that the capture pipeline already surfaces in its tracing summary; the stable token format is documented in the ktstr ctprof capture CLI help. privilege_dominant mirrors the same gate that prints the EPERM remediation hint — true when ≥ 50% of failed is ptrace-seize or ptrace-interrupt.

The four counters are zero when the probe pass reached zero tgids (e.g. an empty proc_root); dominant_failure is None when no actionable failures landed; privilege_dominant is false when there are no failures or when ptrace failures are strictly less than half of failed (the >= 50% gate accepts equality at the boundary).

§Examples

let snap = ktstr::ctprof::capture();
if let Some(ps) = &snap.probe_summary {
    if let Some(hint) = ps.remediation_hint() {
        eprintln!("{hint}");
    }
    if let Some(tag) = &ps.dominant_failure {
        eprintln!("dominant failure: {tag}");
    }
}

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.
§tgids_walked: u64

Total tgids the probe pass walked. Equals the number of /proc/<pid> directories the capture saw, minus the calling process’s own tgid (which is skipped because PTRACE_SEIZE rejects self-attach).

§jemalloc_detected: u64

Tgids whose attach_jemalloc_at call succeeded — i.e. the target was identified as jemalloc-linked, the TSD symbol resolved, and the per-tsd_s field offsets came out of the DWARF walk. A subset of tgids_walked.

§probed_ok: u64

Per-thread probe reads that returned a counter pair. Bounded above by the sum of thread counts across all jemalloc_detected tgids; per-thread failures (target thread exited mid-attach, EPERM, etc.) reduce this count below the upper bound.

§failed: u64

Attach-or-probe failures whose tag is classified ACTIONABLE — see the ktstr ctprof capture CLI help for the full filter rule and tag taxonomy. Routine non-actionable outcomes (target not jemalloc-linked, readlink race-with-exit) do NOT contribute to this count.

§dominant_failure: Option<String>

Tag string for the most-frequent actionable failure across all attach-and-probe failures. None when failed == 0. Stable single-word identifiers — the wire contract that downstream consumers match against. The full taxonomy is documented in the ktstr ctprof capture CLI help. Examples: "ptrace-seize", "dwarf-parse-failure", "jemalloc-in-dso".

§privilege_dominant: bool

true when the ptrace failure share crosses the hint-trigger threshold (≥ 50% of failed is ptrace-seize or ptrace-interrupt). Mirrors the same gate that prints the EPERM remediation hint in the operator-facing tracing summary, so a downstream consumer can reproduce that signal without parsing the log line. When true, rerunning the capture binary with CAP_SYS_PTRACE (e.g. sudo setcap cap_sys_ptrace+eip $(which ktstr), or run as root, or sysctl kernel.yama.ptrace_scope=0) resolves most attach failures so jemalloc TSD attach succeeds across foreign tgids. false when failed == 0 (no failures to dominate) or when ptrace failures are strictly less than half of failed (the >= 50% gate accepts equality at the boundary).

Independent of Self::dominant_failure: ptrace failures are tallied across both ptrace-seize and ptrace-interrupt for the threshold, while dominant_failure reports a single per-tag plurality. When ptrace counts split across the two tags, privilege_dominant may be true while dominant_failure names a non-ptrace tag that won the single-tag plurality. Conversely, dominant_failure may name a ptrace tag while privilege_dominant is false when ptrace failures are below the 50% threshold.

Implementations§

Source§

impl CtprofProbeSummary

Source

pub fn remediation_hint(&self) -> Option<&'static str>

Operator-facing remediation hint when ptrace failures dominate the snapshot. Returns Some(&'static str) — the same PTRACE_EPERM_HINT constant the capture pipeline embeds in its tracing summary line (a one-liner naming cap_sys_ptrace — the setcap-form spelling of the capability — and kernel.yama.ptrace_scope), or None when Self::privilege_dominant is false. Lets a downstream consumer surface the same fix-it message without parsing the log line or hand-rolling the gate.

Trait Implementations§

Source§

impl Clone for CtprofProbeSummary

Source§

fn clone(&self) -> CtprofProbeSummary

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 CtprofProbeSummary

Source§

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

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

impl Default for CtprofProbeSummary

Source§

fn default() -> CtprofProbeSummary

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

impl<'de> Deserialize<'de> for CtprofProbeSummary

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 CtprofProbeSummary

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,