Get LFQ item before capturing callstack.

This is to ensure that thread local structures have been properly
initialized (lock-free queue buffers are thread local), as capturing
callstack involves allocating memory from rpmalloc, which must be
initialized in each thread before allocation.
This commit is contained in:
Bartosz Taudul 2020-09-29 15:10:55 +02:00
parent d530472045
commit 8eb51aa01d

View File

@ -2825,10 +2825,9 @@ void Profiler::ReportTopology()
void Profiler::SendCallstack( int depth, const char* skipBefore )
{
#ifdef TRACY_HAS_CALLSTACK
TracyLfqPrepare( QueueType::Callstack );
auto ptr = Callstack( depth );
CutCallstack( ptr, skipBefore );
TracyLfqPrepare( QueueType::Callstack );
MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
TracyLfqCommit;
#endif