|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
CPU load monitoring. More...
Namespaces | |
| namespace | detail |
Classes | |
| class | AudioBudget |
| struct | CycleScope |
| struct | NamedSection |
| struct | SectionProfile |
Functions | |
| void | dwt_init () |
| Initialize DWT cycle counter. Call once after clock configuration. | |
| uint32_t | cycles () |
| int | format_report (char *buf, size_t size, const AudioBudget &budget, const NamedSection *sections, size_t n) |
| Format a profiling report into a buffer. | |
| int | format_tagged_report (char *buf, size_t size, const AudioBudget &budget, const NamedSection *sections, size_t n) |
| Format profiling data as tagged output lines. | |
| int | format_tagged_histogram (char *buf, size_t size, const AudioBudget &budget) |
| Format CPU load histogram as a tagged output line. | |
CPU load monitoring.
DWT cycle counter and AudioBudget tracking for real-time audio:
dwt_init() / dwt_cycles() - ARM DWT cycle counterSBL_PROFILING_ENABLED
|
inline |
Read current cycle count (free-running, wraps at 2^32). Unsigned subtraction handles wraparound correctly.
Definition at line 47 of file dwt.hpp.
References sbl::profiling::detail::DWT_CYCCNT.
Referenced by sbl::profiling::AudioBudget::on_block_end(), sbl::profiling::AudioBudget::on_block_start(), and sbl::profiling::CycleScope::~CycleScope().
|
inline |
Initialize DWT cycle counter. Call once after clock configuration.
Definition at line 38 of file dwt.hpp.
References sbl::profiling::detail::CYCCNTENA_BIT, sbl::profiling::detail::DEMCR, sbl::profiling::detail::DWT_CTRL, sbl::profiling::detail::DWT_CYCCNT, sbl::profiling::detail::DWT_LAR, sbl::profiling::detail::LAR_UNLOCK, and sbl::profiling::detail::TRCENA_BIT.
|
inline |
Format a profiling report into a buffer.
| buf | Output buffer |
| size | Buffer size |
| budget | AudioBudget instance |
| sections | Array of named section profiles |
| n | Number of sections |
Definition at line 55 of file report.hpp.
References sbl::profiling::AudioBudget::avg_load(), sbl::log::format(), sbl::profiling::AudioBudget::overruns(), and sbl::profiling::AudioBudget::peak_load().
|
inline |
Format CPU load histogram as a tagged output line.
Emits a single #HIST line with 11 bucket counts (10% each, last is >100%).
Definition at line 143 of file report.hpp.
References sbl::log::format(), sbl::profiling::AudioBudget::hist_bucket(), and sbl::profiling::AudioBudget::hist_size().
|
inline |
Format profiling data as tagged output lines.
Emits one #PROF summary line followed by one #PROF.<NAME> line per section. Section names are uppercased in the tag (e.g., "osc" → #PROF.OSC).
Definition at line 107 of file report.hpp.
References sbl::profiling::AudioBudget::avg_load(), sbl::profiling::AudioBudget::count(), sbl::log::format(), sbl::profiling::AudioBudget::min_load(), sbl::profiling::AudioBudget::overruns(), and sbl::profiling::AudioBudget::peak_load().