Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
section.hpp File Reference

Per-section tick profiling with EWMA smoothing. More...

Detailed Description

Per-section tick profiling with EWMA smoothing.

Measures ticks 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::diagnostics::SectionProfile s_prof_osc; static sbl::diagnostics::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.

#include <cstdint>

Go to the source code of this file.

Classes

struct  sbl::diagnostics::SectionProfile
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::diagnostics
 Diagnostics and profiling.
 

Macros

#define SBL_PROF_MARK(var)   (void)0
 Mark a timestamp variable for section profiling.
 
#define SBL_PROF_SECTION(section, start)   (void)0
 Measure ticks since 'start', update section profile, advance start.
 

Macro Definition Documentation

◆ SBL_PROF_MARK

#define SBL_PROF_MARK (   var)    (void)0

Mark a timestamp variable for section profiling.

Definition at line 60 of file section.hpp.

◆ SBL_PROF_SECTION

#define SBL_PROF_SECTION (   section,
  start 
)    (void)0

Measure ticks since 'start', update section profile, advance start.

Definition at line 71 of file section.hpp.