Expand description
Lightweight TSC-based performance counters for critical kernel paths.
Each counter pair tracks total TSC cycles spent + call count.
Use PerfScope (RAII) to instrument a section without touching the
hot path more than two rdtsc calls + two relaxed atomic adds.
Structs§
- Perf
Scope - Measures elapsed TSC cycles between construction and drop, accumulating into the given counter pair.
- Perf
Stat - Summary of one counter pair, ready for display.
Statics§
- CTX_
SWITCH_ COUNT - Post-switch fixup (
finish_interrupt_switch). - CTX_
SWITCH_ TSC - IRQ_
TIMER_ COUNT - Timer IRQ handler (
timer_tick). - IRQ_
TIMER_ TSC - SCHED_
PREEMPT_ COUNT - Preemption path (
maybe_preempt). - SCHED_
PREEMPT_ TSC - SCHED_
YIELD_ COUNT - Scheduler lock acquisition in
yield_task. - SCHED_
YIELD_ TSC
Functions§
- snapshot
- Return a snapshot of all perf counters.