Add SPSC symbol queue.

This commit is contained in:
Bartosz Taudul 2021-10-22 22:22:27 +02:00
parent f2b0aadedc
commit b4cfb1f2d5
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 18 additions and 0 deletions

View File

@ -1289,6 +1289,7 @@ Profiler::Profiler()
, m_fiQueue( 16 )
, m_fiDequeue( 16 )
#endif
, m_symbolQueue( 64*1024 )
, m_frameCount( 0 )
, m_isConnected( false )
#ifdef TRACY_ON_DEMAND

View File

@ -8,6 +8,7 @@
#include <time.h>
#include "tracy_concurrentqueue.h"
#include "tracy_readerwriterqueue.h"
#include "TracyCallstack.hpp"
#include "TracySysTime.hpp"
#include "TracyFastVector.hpp"
@ -139,6 +140,20 @@ class Profiler
bool flip;
};
enum class SymbolQueueItemType
{
CallstackFrame,
SymbolQuery,
CodeLocation,
ExternalName
};
struct SymbolQueueItem
{
SymbolQueueItemType type;
uint64_t ptr;
};
public:
Profiler();
~Profiler();
@ -813,6 +828,8 @@ private:
TracyMutex m_fiLock;
#endif
ReaderWriterQueue<SymbolQueueItem> m_symbolQueue;
std::atomic<uint64_t> m_frameCount;
std::atomic<bool> m_isConnected;
#ifdef TRACY_ON_DEMAND