Skip to main content

Module perf_counters

Module perf_counters 

Source
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§

PerfScope
Measures elapsed TSC cycles between construction and drop, accumulating into the given counter pair.
PerfStat
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.