25 #ifndef ACE_ROUTINE_LOG_BIN_PROFILER_H
26 #define ACE_ROUTINE_LOG_BIN_PROFILER_H
31 #include "CoroutineProfiler.h"
34 namespace ace_routine {
53 template <
typename T_COROUTINE>
84 if (micros == 0)
break;
87 uint16_t count =
mBins[index];
88 if (count < UINT16_MAX) {
107 T_COROUTINE** root = T_COROUTINE::getRoot();
108 for (T_COROUTINE** p = root; (*p) !=
nullptr; p = (*p)->getNext()) {
110 (*p)->setProfiler(profiler);
116 T_COROUTINE** root = T_COROUTINE::getRoot();
117 for (T_COROUTINE** p = root; (*p) !=
nullptr; p = (*p)->getNext()) {
121 (*p)->setProfiler(
nullptr);
128 T_COROUTINE** root = T_COROUTINE::getRoot();
129 for (T_COROUTINE** p = root; (*p) !=
nullptr; p = (*p)->getNext()) {
155 void rollupExteriorBins(
157 const uint16_t src[],
All coroutines are instances of the Coroutine base class.
An interface class for profiling classes that can track the elapsed time consumed by Coroutine::runCo...
Class that maintains the frequency count of the elapsed time of runCoroutine() in an array of bins wh...
void clear()
Clear the bins.
static void clearProfilers()
Clear counters for all profilers.
LogBinProfilerTemplate()
Constructor.
uint16_t mBins[kNumBins]
Event count bins.
static void deleteProfilers()
Delete the profilers created by createProfilers().
void updateElapsedMicros(uint32_t micros) override
Update the count for the calculated elapsed time bin.
static void createProfilers()
Create a new profiler on the heap and attach it to each coroutine.
static const uint8_t kNumBins
Number of event counter bins used by this class.