Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::system::profiling::Entry Struct Reference

Detailed Description

One entry of the table: its live statistics and its last window. The layout is in the Registry comment.

Definition at line 65 of file registry.hpp.

#include <registry.hpp>

Public Member Functions

constexpr bool is (Kind k) const
 True if the entry is of this kind.
 
void measure (uint32_t cycles)
 Record one measurement: the count, the running average (alpha 1/128), the window's extremes.
 
void open_window ()
 
void close_window ()
 
void clear ()
 

Public Attributes

uint32_t kind = 0
 
char name [NAME_SIZE] = {}
 
uint32_t count = 0
 
float avg = 0.0f
 
uint32_t max = 0
 
uint32_t min = NO_MINIMUM
 
uint32_t overruns = 0
 
uint32_t limit = 0
 
uint32_t window_count = 0
 
float window_avg = 0.0f
 
uint32_t window_max = 0
 
uint32_t window_min = 0
 
uint32_t window_overruns = 0
 
uint32_t window_base = 0
 

Static Public Attributes

static constexpr float AVERAGE_ALPHA = 1.0f / 128.0f
 

Member Function Documentation

◆ is()

constexpr bool sbl::system::profiling::Entry::is ( Kind  k) const
inlineconstexpr

True if the entry is of this kind.

Parameters
kKind to test
Returns
kind == k

Definition at line 86 of file registry.hpp.

References kind.

◆ measure()

void sbl::system::profiling::Entry::measure ( uint32_t  cycles)
inline

Record one measurement: the count, the running average (alpha 1/128), the window's extremes.

Parameters
cyclesMeasured cycles

Definition at line 92 of file registry.hpp.

References AVERAGE_ALPHA, avg, count, sbl::system::profiling::cycles(), max, and min.

Referenced by sbl::system::profiling::AudioBudget::on_block_end().

◆ open_window()

void sbl::system::profiling::Entry::open_window ( )
inline

Start a window over: the extremes and the overruns. The average and the count go on.

Definition at line 104 of file registry.hpp.

References max, min, sbl::system::profiling::NO_MINIMUM, and overruns.

Referenced by clear(), and close_window().

◆ close_window()

void sbl::system::profiling::Entry::close_window ( )
inline

Copy the statistics into the window fields and start the next window.

Definition at line 111 of file registry.hpp.

References avg, count, max, min, sbl::system::profiling::NO_MINIMUM, open_window(), overruns, window_avg, window_base, window_count, window_max, window_min, and window_overruns.

◆ clear()

void sbl::system::profiling::Entry::clear ( )
inline

Forget every statistic. The kind, the name and the limit stay.

Definition at line 122 of file registry.hpp.

References avg, count, open_window(), window_avg, window_base, window_count, window_max, window_min, and window_overruns.

Member Data Documentation

◆ kind

uint32_t sbl::system::profiling::Entry::kind = 0

a Kind value

Definition at line 66 of file registry.hpp.

Referenced by is().

◆ name

char sbl::system::profiling::Entry::name[NAME_SIZE] = {}

NUL-terminated, 11 characters at most

Definition at line 67 of file registry.hpp.

◆ count

uint32_t sbl::system::profiling::Entry::count = 0

blocks, passes or events since the start

Definition at line 68 of file registry.hpp.

Referenced by clear(), close_window(), and measure().

◆ avg

float sbl::system::profiling::Entry::avg = 0.0f

running average in cycles (budget, section)

Definition at line 69 of file registry.hpp.

Referenced by clear(), close_window(), and measure().

◆ max

uint32_t sbl::system::profiling::Entry::max = 0

largest in the open window, in cycles

Definition at line 70 of file registry.hpp.

Referenced by close_window(), measure(), and open_window().

◆ min

uint32_t sbl::system::profiling::Entry::min = NO_MINIMUM

smallest in the open window; NO_MINIMUM before the first

Definition at line 71 of file registry.hpp.

Referenced by close_window(), measure(), and open_window().

◆ overruns

uint32_t sbl::system::profiling::Entry::overruns = 0

budget: blocks over the limit in the open window

Definition at line 72 of file registry.hpp.

Referenced by close_window(), sbl::system::profiling::AudioBudget::on_block_end(), and open_window().

◆ limit

uint32_t sbl::system::profiling::Entry::limit = 0

budget: cycles a block may take

Definition at line 73 of file registry.hpp.

Referenced by sbl::system::profiling::AudioBudget::on_block_end().

◆ window_count

uint32_t sbl::system::profiling::Entry::window_count = 0

blocks, passes or events in the last window

Definition at line 74 of file registry.hpp.

Referenced by clear(), and close_window().

◆ window_avg

float sbl::system::profiling::Entry::window_avg = 0.0f

avg when the window closed

Definition at line 75 of file registry.hpp.

Referenced by clear(), and close_window().

◆ window_max

uint32_t sbl::system::profiling::Entry::window_max = 0

max of the window; 0 if it measured nothing

Definition at line 76 of file registry.hpp.

Referenced by clear(), and close_window().

◆ window_min

uint32_t sbl::system::profiling::Entry::window_min = 0

min of the window; 0 if it measured nothing

Definition at line 77 of file registry.hpp.

Referenced by clear(), and close_window().

◆ window_overruns

uint32_t sbl::system::profiling::Entry::window_overruns = 0

overruns of the window

Definition at line 78 of file registry.hpp.

Referenced by clear(), and close_window().

◆ window_base

uint32_t sbl::system::profiling::Entry::window_base = 0

count when the window closed

Definition at line 79 of file registry.hpp.

Referenced by clear(), and close_window().

◆ AVERAGE_ALPHA

constexpr float sbl::system::profiling::Entry::AVERAGE_ALPHA = 1.0f / 128.0f
staticconstexpr

The running average's weight for a new measurement (about 130 ms to settle at 1 ms blocks).

Definition at line 135 of file registry.hpp.

Referenced by measure().


The documentation for this struct was generated from the following file: