20#ifndef FL_STACK_TRACE_MAX_DEPTH
21#define FL_STACK_TRACE_MAX_DEPTH 32
74 if (storage.stackDepth == 0) {
85 if (!storage.callStack.empty() && storage.stackDepth < storage.callStack.size()) {
87 storage.callStack.resize(storage.callStack.size() - 1);
100 fl::sprintf(depth_str,
"%zu", (
size_t)storage.stackDepth);
104 if (storage.callStack.empty()) {
111 result +=
" <WARNING: Stack overflow - showing last ";
121 for (fl::size i = 0; i < storage.callStack.size(); ++i) {
122 const auto& entry = storage.callStack[i];
124 if (entry.line > 0) {
125 fl::sprintf(line_buf,
" [%zu] %s(%d)\n", (
size_t)i, entry.function, entry.line);
127 fl::sprintf(line_buf,
" [%zu] %s\n", (
size_t)i, entry.function);
144 for (fl::size i = 0; i < storage.callStack.size(); ++i) {
145 const auto& entry = storage.callStack[i];
148 out->push_back(
fl::make_tuple(entry.function, entry.line, fl::u32(0)));
154 storage.callStack.resize(0);
155 storage.stackDepth = 0;
FastLED chrono implementation - duration types for time measurements.
static void push(const char *function, int line) FL_NOEXCEPT
Push a function name onto the call stack.
static void pop() FL_NOEXCEPT
Pop the most recent function from the call stack.
ScopedTrace(const char *function, int line) FL_NOEXCEPT
Construct and push function name onto stack.
static void clear() FL_NOEXCEPT
Clear the entire call stack (primarily for testing)
static fl::size depth() FL_NOEXCEPT
Get the current stack depth.
~ScopedTrace() FL_NOEXCEPT
Destructor - automatically pops from stack.
static fl::string dump() FL_NOEXCEPT
Dump the current call stack to a string.
static T & instance() FL_NOEXCEPT
Centralized logging categories for FastLED hardware interfaces and subsystems.
static TraceStorage & getTraceStorage() FL_NOEXCEPT
int sprintf(char(&buffer)[N], const char *format, const Args &... args) FL_NOEXCEPT
Sprintf-like formatting function that writes to a buffer.
tuple< typename fl::decay< Ts >::type... > make_tuple(Ts &&... args) FL_NOEXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
Base definition for an LED controller.
FixedVector< TraceEntry, FL_STACK_TRACE_MAX_DEPTH > callStack
Internal storage for the trace system Encapsulates call stack and depth tracking per-thread.
TraceEntry(const char *f, int l) FL_NOEXCEPT
A single stack trace entry with location information.
#define FL_STACK_TRACE_MAX_DEPTH