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::snprintf(depth_str,
sizeof(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::snprintf(line_buf,
sizeof(line_buf),
" [%zu] %s(%d)\n", (
size_t)i, entry.function, entry.line);
127 fl::snprintf(line_buf,
sizeof(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 pop() FL_NO_EXCEPT
Pop the most recent function from the call stack.
static void clear() FL_NO_EXCEPT
Clear the entire call stack (primarily for testing)
ScopedTrace(const char *function, int line) FL_NO_EXCEPT
Construct and push function name onto stack.
static void push(const char *function, int line) FL_NO_EXCEPT
Push a function name onto the call stack.
static fl::size depth() FL_NO_EXCEPT
Get the current stack depth.
static fl::string dump() FL_NO_EXCEPT
Dump the current call stack to a string.
~ScopedTrace() FL_NO_EXCEPT
Destructor - automatically pops from stack.
static T & instance() FL_NO_EXCEPT
Centralized logging categories for FastLED hardware interfaces and subsystems.
tuple< typename fl::decay< Ts >::type... > make_tuple(Ts &&... args) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
static TraceStorage & getTraceStorage() FL_NO_EXCEPT
int snprintf(char *buffer, fl::size size, const char *format) FL_NO_EXCEPT
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_NO_EXCEPT
TraceEntry() FL_NO_EXCEPT
A single stack trace entry with location information.
#define FL_STACK_TRACE_MAX_DEPTH