15#ifndef SBL_CONTROL_SCHEDULER_REPORT_HPP_
16#define SBL_CONTROL_SCHEDULER_REPORT_HPP_
25inline constexpr uint32_t
ticks_to_us(uint64_t ticks, uint32_t ticks_per_second) {
26 constexpr uint64_t US_PER_SECOND = 1000000;
27 return ticks_per_second ?
static_cast<uint32_t
>(ticks * US_PER_SECOND / ticks_per_second) : 0;
34template<
typename Output,
typename Sched>
37 line.
field(
"late", scheduler.late_runs(slot))
38 .
field(
"skipped", scheduler.skipped_periods(slot))
39 .
field(
"delay_us",
ticks_to_us(scheduler.worst_delay_ticks(slot), ticks_per_second));
40 line.template write<Output>();
One #TAG key=value ... line in a fixed buffer.
TaggedLine & field(const char *key, float value, uint8_t decimals=3)
A float field, rounded to decimals places.
The control stack: scheduler, event queue, merge, CC mapping, calibration.
void write_scheduler_report(const Sched &scheduler, uint8_t slot, uint32_t ticks_per_second)
constexpr uint32_t ticks_to_us(uint64_t ticks, uint32_t ticks_per_second)
Tagged output lines: a builder and a throttled value report.