diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 72061753..b811d6f4 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1526,6 +1526,43 @@ void Profiler::CalibrateDelay() } } +void Profiler::SendCallstack( int depth, uint64_t thread, const char* skipBefore ) +{ +#ifdef TRACY_HAS_CALLSTACK + auto ptr = Callstack( depth ); + auto data = (uintptr_t*)ptr; + const auto sz = *data++; + int i; + for( i=0; iget_tail_index(); + auto item = token->enqueue_begin( magic ); + MemWrite( &item->hdr.type, QueueType::Callstack ); + MemWrite( &item->callstack.ptr, ptr ); + MemWrite( &item->callstack.thread, thread ); + tail.store( magic + 1, std::memory_order_release ); +#endif +} + } #endif diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 4e9491f5..40219b38 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -325,6 +325,8 @@ public: #endif } + void SendCallstack( int depth, uint64_t thread, const char* skipBefore ); + static bool ShouldExit(); #ifdef TRACY_ON_DEMAND