|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Per-section cycle profiling with EWMA smoothing. More...
#include <cstdint>Go to the source code of this file.
Classes | |
| struct | sbl::profiling::SectionProfile |
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs functionality. | |
| namespace | sbl::profiling |
| CPU load monitoring. | |
Macros | |
| #define | SBL_PROF_MARK(var) (void)0 |
| Mark a timestamp variable for section profiling. | |
| #define | SBL_PROF_SECTION(section, start) (void)0 |
| Measure cycles since 'start', update section profile, advance start. | |
Per-section cycle profiling with EWMA smoothing.
Measures CPU cycles consumed by named code sections in audio callbacks. Uses integer EWMA (alpha = 1/128, shift-based) for low-overhead smoothing.
Gated behind SBL_PROFILING_ENABLED. When disabled, SectionProfile::avg is a static constexpr zero so format strings compile without #ifdef.
Usage: static sbl::profiling::SectionProfile s_prof_osc; static sbl::profiling::SectionProfile s_prof_svf;
void audio_callback(...) { SBL_PROF_MARK(t); // ... oscillator rendering ... SBL_PROF_SECTION(s_prof_osc, t); // ... filter processing ... SBL_PROF_SECTION(s_prof_svf, t); }
Definition in file section.hpp.
| #define SBL_PROF_MARK | ( | var | ) | (void)0 |
Mark a timestamp variable for section profiling.
Definition at line 58 of file section.hpp.
| #define SBL_PROF_SECTION | ( | section, | |
| start | |||
| ) | (void)0 |
Measure cycles since 'start', update section profile, advance start.
Definition at line 69 of file section.hpp.