- Drop trailing underscore on ComponentRuntimeStats::global_recorded_us
(public static, clang-tidy readability-identifier-naming).
- Use double instead of float for uint64_t microsecond → millisecond
conversions on the main_loop and main_loop_overhead_section lines.
Float's ~7-digit mantissa loses resolution on multi-day totals that
reach into the 10^8-10^9 microsecond range.
The scheduler also constructs WarnIfComponentBlockingGuard around
scheduled item execution (scheduler.cpp:740), so set_interval /
set_timeout / defer callbacks record into the affected component's
runtime_stats_. Since scheduler.call() runs inside before_loop_tasks_,
that time was double-counted: once in component period/total, once
in the "before" overhead bucket. Observed in the field as
before > overhead_total with inter_component clamped to 0.
Fix: add a global cumulative counter on ComponentRuntimeStats that
record_time() bumps on every guard finish, snapshot it around
before_loop_tasks_, and subtract the delta from the before bucket
before passing it to record_loop_active.
Adds a second log line per section that breaks overhead down into:
before — time in before_loop_tasks_ (scheduler + ISR enable_loop)
tail — time in after_loop_tasks_ + trailing record prefix
inter_component — residual: per-iteration bookkeeping between components
(set_current_component, WarnIfComponentBlockingGuard
construction/destruction, feed_wdt_with_time, the for
loop itself)
Useful for isolating whether per-loop overhead changes come from
scheduler work, loop teardown, or inter-component bookkeeping.
- Widen period/total iteration counters to uint64_t to avoid wrapping on
long-running high-frequency loops.
- Compute total component-time sum over all components (not just the
period-active subset) so total overhead is not inflated by components
that ran earlier but are idle now.
- Extend integration test to parse the main_loop line and validate the
iters/active_avg/active_total/overhead_total fields.
Records per-iteration active wall time (excluding yield/sleep) and
reports it alongside the component table. Overhead is computed at log
time as active_total minus the sum of per-component time, exposing time
spent in scheduler dispatch, before/after-loop tasks, and other loop
machinery not attributed to any component.
Replace mutable tag references with immutable commit SHAs
to prevent supply-chain attacks via compromised tags.
Version comments are preserved for readability.