#[repr(transparent)]pub struct DeadCounter(pub u64);Expand description
Kernel counter whose update path is permanently dead. The
field exists in task_struct (and is exposed via
/proc/<tid>/sched) but no kernel writer touches it on any
current code path.
Examples that historically motivated this newtype:
nr_wakeups_idle, nr_migrations_cold, nr_wakeups_passive
— these fields were removed from
crate::ctprof::ThreadState because no kernel code
path increments them on 6.16 or 7.1 (no
schedstat_inc(p->stats.nr_wakeups_idle) /
nr_migrations_cold / nr_wakeups_passive call site exists
anywhere under kernel/). The newtype remains as
infrastructure for future dead counters that get exposed in
/proc before (or instead of) being wired up as live
counters.
Wire format matches MonotonicCount (u64,
serde(transparent)); the capture pipeline parses the same
procfs lines and stores the same bits. The type-system
difference is in the trait list: a MonotonicCount is
Summable / Maxable, while DeadCounter is neither.
A registry entry that pairs a DeadCounter field with a
Summable-bound AggRule variant fails to compile,
flagging the dead status at the type level rather than
surfacing as a “0 + 0 + 0” rendered cell.
§Migration affordance
A field can be flipped from MonotonicCount to
DeadCounter without regenerating any .ctprof.zst snapshot
files: the repr(transparent) + serde(transparent) wire
format is structurally identical (a bare u64). Existing
snapshots deserialize unchanged. The flip changes only the
in-memory trait surface, which the registry consumes through
AggRule accessors — adjusting those (or removing the
field’s registry entry entirely) is the only edit beyond the
field type itself.
Defaults to zero. The reduction-trait omission is
deliberate: all four reductions (Summable::sum_across,
Maxable::max_across, Rangeable::range_across,
Modeable::mode_across) on a column of structural zeros
trivially produce zero, but rendering that “zero” through a
live reduction implies “we measured zero events” when the
truth is “we measured a kernel-side dead pointer.” Either
add a no-op AggRule variant in the migration batch, or
drop these fields from the registry entirely — both are the
migration batch’s call.
Tuple Fields§
§0: u64Trait Implementations§
Source§impl Clone for DeadCounter
impl Clone for DeadCounter
Source§fn clone(&self) -> DeadCounter
fn clone(&self) -> DeadCounter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeadCounter
impl Debug for DeadCounter
Source§impl Default for DeadCounter
impl Default for DeadCounter
Source§fn default() -> DeadCounter
fn default() -> DeadCounter
Source§impl<'de> Deserialize<'de> for DeadCounter
impl<'de> Deserialize<'de> for DeadCounter
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>,
Source§impl Display for DeadCounter
impl Display for DeadCounter
Source§impl From<DeadCounter> for u64
impl From<DeadCounter> for u64
Source§fn from(v: DeadCounter) -> Self
fn from(v: DeadCounter) -> Self
Source§impl From<u64> for DeadCounter
impl From<u64> for DeadCounter
Source§impl Hash for DeadCounter
impl Hash for DeadCounter
Source§impl Ord for DeadCounter
impl Ord for DeadCounter
Source§fn cmp(&self, other: &DeadCounter) -> Ordering
fn cmp(&self, other: &DeadCounter) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DeadCounter
impl PartialEq for DeadCounter
Source§impl PartialOrd for DeadCounter
impl PartialOrd for DeadCounter
Source§impl Serialize for DeadCounter
impl Serialize for DeadCounter
impl Copy for DeadCounter
impl Eq for DeadCounter
impl StructuralPartialEq for DeadCounter
Auto Trait Implementations§
impl Freeze for DeadCounter
impl RefUnwindSafe for DeadCounter
impl Send for DeadCounter
impl Sync for DeadCounter
impl Unpin for DeadCounter
impl UnwindSafe for DeadCounter
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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