1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Callstack capture for ZoneBegin.

This commit is contained in:
Bartosz Taudul
2018-06-22 00:56:01 +02:00
parent c0b086240c
commit b6088b908f
5 changed files with 64 additions and 0 deletions
+15
View File
@@ -238,6 +238,21 @@ public:
s_profiler.m_serialLock.unlock();
}
static tracy_force_inline void SendCallstack( int depth, uint64_t thread )
{
#ifdef TRACY_HAS_CALLSTACK
auto ptr = Callstack( depth );
Magic magic;
auto& token = s_token.ptr;
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<moodycamel::CanAlloc>( 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
}
static bool ShouldExit();
private: