mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Wrap concurrentqueue in tracy namespace
This commit is contained in:
parent
3e012cb762
commit
6b87aecdce
12
TracyLua.hpp
12
TracyLua.hpp
@ -163,7 +163,7 @@ static inline int LuaZoneBegin( lua_State* L )
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||||
@ -221,7 +221,7 @@ static inline int LuaZoneBeginN( lua_State* L )
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||||
@ -252,7 +252,7 @@ static inline int LuaZoneEnd( lua_State* L )
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
||||||
@ -286,7 +286,7 @@ static inline int LuaZoneText( lua_State* L )
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneText );
|
MemWrite( &item->hdr.type, QueueType::ZoneText );
|
||||||
MemWrite( &item->zoneText.thread, GetThreadHandle() );
|
MemWrite( &item->zoneText.thread, GetThreadHandle() );
|
||||||
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
||||||
@ -314,7 +314,7 @@ static inline int LuaZoneName( lua_State* L )
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneName );
|
MemWrite( &item->hdr.type, QueueType::ZoneName );
|
||||||
MemWrite( &item->zoneText.thread, GetThreadHandle() );
|
MemWrite( &item->zoneText.thread, GetThreadHandle() );
|
||||||
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
||||||
@ -337,7 +337,7 @@ static inline int LuaMessage( lua_State* L )
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::Message );
|
MemWrite( &item->hdr.type, QueueType::Message );
|
||||||
MemWrite( &item->message.time, Profiler::GetTime() );
|
MemWrite( &item->message.time, Profiler::GetTime() );
|
||||||
MemWrite( &item->message.thread, GetThreadHandle() );
|
MemWrite( &item->message.thread, GetThreadHandle() );
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
|
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
|
||||||
MemWrite( &item->gpuNewContext.cpuTime, tcpu );
|
MemWrite( &item->gpuNewContext.cpuTime, tcpu );
|
||||||
MemWrite( &item->gpuNewContext.gpuTime, tgpu );
|
MemWrite( &item->gpuNewContext.gpuTime, tgpu );
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
uint64_t time;
|
uint64_t time;
|
||||||
glGetQueryObjectui64v( m_query[m_tail], GL_QUERY_RESULT, &time );
|
glGetQueryObjectui64v( m_query[m_tail], GL_QUERY_RESULT, &time );
|
||||||
|
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
||||||
MemWrite( &item->gpuTime.gpuTime, (int64_t)time );
|
MemWrite( &item->gpuTime.gpuTime, (int64_t)time );
|
||||||
MemWrite( &item->gpuTime.queryId, (uint16_t)m_tail );
|
MemWrite( &item->gpuTime.queryId, (uint16_t)m_tail );
|
||||||
@ -184,7 +184,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneBegin );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneBegin );
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -210,7 +210,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstack );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstack );
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -233,7 +233,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneEnd );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneEnd );
|
||||||
MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) );
|
MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) );
|
||||||
|
@ -100,7 +100,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
|
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
|
||||||
MemWrite( &item->gpuNewContext.cpuTime, tcpu );
|
MemWrite( &item->gpuNewContext.cpuTime, tcpu );
|
||||||
MemWrite( &item->gpuNewContext.gpuTime, tgpu );
|
MemWrite( &item->gpuNewContext.gpuTime, tgpu );
|
||||||
@ -160,7 +160,7 @@ public:
|
|||||||
|
|
||||||
for( unsigned int idx=0; idx<cnt; idx++ )
|
for( unsigned int idx=0; idx<cnt; idx++ )
|
||||||
{
|
{
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
||||||
MemWrite( &item->gpuTime.gpuTime, res[idx] );
|
MemWrite( &item->gpuTime.gpuTime, res[idx] );
|
||||||
MemWrite( &item->gpuTime.queryId, uint16_t( m_tail + idx ) );
|
MemWrite( &item->gpuTime.queryId, uint16_t( m_tail + idx ) );
|
||||||
@ -219,7 +219,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneBegin );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneBegin );
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -247,7 +247,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstack );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstack );
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -271,7 +271,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuZoneEnd );
|
MemWrite( &item->hdr.type, QueueType::GpuZoneEnd );
|
||||||
MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) );
|
MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) );
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockAnnounce );
|
MemWrite( &item->hdr.type, QueueType::LockAnnounce );
|
||||||
MemWrite( &item->lockAnnounce.id, m_id );
|
MemWrite( &item->lockAnnounce.id, m_id );
|
||||||
MemWrite( &item->lockAnnounce.lckloc, (uint64_t)srcloc );
|
MemWrite( &item->lockAnnounce.lckloc, (uint64_t)srcloc );
|
||||||
@ -68,7 +68,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockWait );
|
MemWrite( &item->hdr.type, QueueType::LockWait );
|
||||||
MemWrite( &item->lockWait.id, m_id );
|
MemWrite( &item->lockWait.id, m_id );
|
||||||
MemWrite( &item->lockWait.thread, thread );
|
MemWrite( &item->lockWait.thread, thread );
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, thread );
|
MemWrite( &item->lockObtain.thread, thread );
|
||||||
@ -109,7 +109,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockRelease );
|
MemWrite( &item->hdr.type, QueueType::LockRelease );
|
||||||
MemWrite( &item->lockRelease.id, m_id );
|
MemWrite( &item->lockRelease.id, m_id );
|
||||||
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
||||||
@ -141,7 +141,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
||||||
@ -168,7 +168,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockMark );
|
MemWrite( &item->hdr.type, QueueType::LockMark );
|
||||||
MemWrite( &item->lockMark.id, m_id );
|
MemWrite( &item->lockMark.id, m_id );
|
||||||
MemWrite( &item->lockMark.thread, GetThreadHandle() );
|
MemWrite( &item->lockMark.thread, GetThreadHandle() );
|
||||||
@ -203,7 +203,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockAnnounce );
|
MemWrite( &item->hdr.type, QueueType::LockAnnounce );
|
||||||
MemWrite( &item->lockAnnounce.id, m_id );
|
MemWrite( &item->lockAnnounce.id, m_id );
|
||||||
MemWrite( &item->lockAnnounce.lckloc, (uint64_t)srcloc );
|
MemWrite( &item->lockAnnounce.lckloc, (uint64_t)srcloc );
|
||||||
@ -242,7 +242,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockWait );
|
MemWrite( &item->hdr.type, QueueType::LockWait );
|
||||||
MemWrite( &item->lockWait.id, m_id );
|
MemWrite( &item->lockWait.id, m_id );
|
||||||
MemWrite( &item->lockWait.thread, thread );
|
MemWrite( &item->lockWait.thread, thread );
|
||||||
@ -257,7 +257,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, thread );
|
MemWrite( &item->lockObtain.thread, thread );
|
||||||
@ -283,7 +283,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockRelease );
|
MemWrite( &item->hdr.type, QueueType::LockRelease );
|
||||||
MemWrite( &item->lockRelease.id, m_id );
|
MemWrite( &item->lockRelease.id, m_id );
|
||||||
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
||||||
@ -315,7 +315,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
MemWrite( &item->hdr.type, QueueType::LockObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
||||||
@ -349,7 +349,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockSharedWait );
|
MemWrite( &item->hdr.type, QueueType::LockSharedWait );
|
||||||
MemWrite( &item->lockWait.id, m_id );
|
MemWrite( &item->lockWait.id, m_id );
|
||||||
MemWrite( &item->lockWait.thread, thread );
|
MemWrite( &item->lockWait.thread, thread );
|
||||||
@ -364,7 +364,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockSharedObtain );
|
MemWrite( &item->hdr.type, QueueType::LockSharedObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, thread );
|
MemWrite( &item->lockObtain.thread, thread );
|
||||||
@ -390,7 +390,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockSharedRelease );
|
MemWrite( &item->hdr.type, QueueType::LockSharedRelease );
|
||||||
MemWrite( &item->lockRelease.id, m_id );
|
MemWrite( &item->lockRelease.id, m_id );
|
||||||
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
|
||||||
@ -422,7 +422,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockSharedObtain );
|
MemWrite( &item->hdr.type, QueueType::LockSharedObtain );
|
||||||
MemWrite( &item->lockObtain.id, m_id );
|
MemWrite( &item->lockObtain.id, m_id );
|
||||||
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
MemWrite( &item->lockObtain.thread, GetThreadHandle() );
|
||||||
@ -449,7 +449,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::LockMark );
|
MemWrite( &item->hdr.type, QueueType::LockMark );
|
||||||
MemWrite( &item->lockMark.id, m_id );
|
MemWrite( &item->lockMark.id, m_id );
|
||||||
MemWrite( &item->lockMark.thread, GetThreadHandle() );
|
MemWrite( &item->lockMark.thread, GetThreadHandle() );
|
||||||
|
@ -45,7 +45,7 @@ struct SourceLocation
|
|||||||
|
|
||||||
struct ProducerWrapper
|
struct ProducerWrapper
|
||||||
{
|
{
|
||||||
moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* ptr;
|
tracy::moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern thread_local ProducerWrapper s_token;
|
extern thread_local ProducerWrapper s_token;
|
||||||
@ -62,7 +62,7 @@ struct VkCtxWrapper
|
|||||||
VkCtx* ptr;
|
VkCtx* ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
using Magic = moodycamel::ConcurrentQueueDefaultTraits::index_t;
|
using Magic = tracy::moodycamel::ConcurrentQueueDefaultTraits::index_t;
|
||||||
|
|
||||||
#if __ARM_ARCH >= 6
|
#if __ARM_ARCH >= 6
|
||||||
extern int64_t (*GetTimeImpl)();
|
extern int64_t (*GetTimeImpl)();
|
||||||
@ -125,7 +125,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::FrameMarkMsg );
|
MemWrite( &item->hdr.type, QueueType::FrameMarkMsg );
|
||||||
MemWrite( &item->frameMark.time, GetTime() );
|
MemWrite( &item->frameMark.time, GetTime() );
|
||||||
tail.store( magic + 1, std::memory_order_release );
|
tail.store( magic + 1, std::memory_order_release );
|
||||||
@ -139,7 +139,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::PlotData );
|
MemWrite( &item->hdr.type, QueueType::PlotData );
|
||||||
MemWrite( &item->plotData.name, (uint64_t)name );
|
MemWrite( &item->plotData.name, (uint64_t)name );
|
||||||
MemWrite( &item->plotData.time, GetTime() );
|
MemWrite( &item->plotData.time, GetTime() );
|
||||||
@ -156,7 +156,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::PlotData );
|
MemWrite( &item->hdr.type, QueueType::PlotData );
|
||||||
MemWrite( &item->plotData.name, (uint64_t)name );
|
MemWrite( &item->plotData.name, (uint64_t)name );
|
||||||
MemWrite( &item->plotData.time, GetTime() );
|
MemWrite( &item->plotData.time, GetTime() );
|
||||||
@ -173,7 +173,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::PlotData );
|
MemWrite( &item->hdr.type, QueueType::PlotData );
|
||||||
MemWrite( &item->plotData.name, (uint64_t)name );
|
MemWrite( &item->plotData.name, (uint64_t)name );
|
||||||
MemWrite( &item->plotData.time, GetTime() );
|
MemWrite( &item->plotData.time, GetTime() );
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::Message );
|
MemWrite( &item->hdr.type, QueueType::Message );
|
||||||
MemWrite( &item->message.time, GetTime() );
|
MemWrite( &item->message.time, GetTime() );
|
||||||
MemWrite( &item->message.thread, GetThreadHandle() );
|
MemWrite( &item->message.thread, GetThreadHandle() );
|
||||||
@ -209,7 +209,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::MessageLiteral );
|
MemWrite( &item->hdr.type, QueueType::MessageLiteral );
|
||||||
MemWrite( &item->message.time, GetTime() );
|
MemWrite( &item->message.time, GetTime() );
|
||||||
MemWrite( &item->message.thread, GetThreadHandle() );
|
MemWrite( &item->message.thread, GetThreadHandle() );
|
||||||
@ -288,7 +288,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::Callstack );
|
MemWrite( &item->hdr.type, QueueType::Callstack );
|
||||||
MemWrite( &item->callstack.ptr, ptr );
|
MemWrite( &item->callstack.ptr, ptr );
|
||||||
MemWrite( &item->callstack.thread, thread );
|
MemWrite( &item->callstack.thread, thread );
|
||||||
@ -319,8 +319,8 @@ private:
|
|||||||
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
||||||
void Worker();
|
void Worker();
|
||||||
|
|
||||||
void ClearQueues( moodycamel::ConsumerToken& token );
|
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
||||||
DequeueStatus Dequeue( moodycamel::ConsumerToken& token );
|
DequeueStatus Dequeue( tracy::moodycamel::ConsumerToken& token );
|
||||||
DequeueStatus DequeueSerial();
|
DequeueStatus DequeueSerial();
|
||||||
bool AppendData( const void* data, size_t len );
|
bool AppendData( const void* data, size_t len );
|
||||||
bool CommitData();
|
bool CommitData();
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
|
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||||
@ -55,7 +55,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneBeginCallstack );
|
MemWrite( &item->hdr.type, QueueType::ZoneBeginCallstack );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||||
@ -79,7 +79,7 @@ public:
|
|||||||
Magic magic;
|
Magic magic;
|
||||||
auto& token = s_token.ptr;
|
auto& token = s_token.ptr;
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||||
#ifdef TRACY_RDTSCP_OPT
|
#ifdef TRACY_RDTSCP_OPT
|
||||||
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneText );
|
MemWrite( &item->hdr.type, QueueType::ZoneText );
|
||||||
MemWrite( &item->zoneText.thread, m_thread );
|
MemWrite( &item->zoneText.thread, m_thread );
|
||||||
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
||||||
@ -121,7 +121,7 @@ public:
|
|||||||
memcpy( ptr, txt, size );
|
memcpy( ptr, txt, size );
|
||||||
ptr[size] = '\0';
|
ptr[size] = '\0';
|
||||||
auto& tail = token->get_tail_index();
|
auto& tail = token->get_tail_index();
|
||||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
|
||||||
MemWrite( &item->hdr.type, QueueType::ZoneName );
|
MemWrite( &item->hdr.type, QueueType::ZoneName );
|
||||||
MemWrite( &item->zoneText.thread, m_thread );
|
MemWrite( &item->zoneText.thread, m_thread );
|
||||||
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
MemWrite( &item->zoneText.text, (uint64_t)ptr );
|
||||||
|
@ -73,6 +73,9 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <thread> // partly for __WINPTHREADS_VERSION if on MinGW-w64 w/ POSIX threading
|
#include <thread> // partly for __WINPTHREADS_VERSION if on MinGW-w64 w/ POSIX threading
|
||||||
|
|
||||||
|
namespace tracy
|
||||||
|
{
|
||||||
|
|
||||||
// Platform-specific definitions of a numeric thread ID type and an invalid value
|
// Platform-specific definitions of a numeric thread ID type and an invalid value
|
||||||
namespace moodycamel { namespace details {
|
namespace moodycamel { namespace details {
|
||||||
template<typename thread_id_t> struct thread_id_converter {
|
template<typename thread_id_t> struct thread_id_converter {
|
||||||
@ -692,8 +695,8 @@ class ConcurrentQueue
|
|||||||
public:
|
public:
|
||||||
struct ExplicitProducer;
|
struct ExplicitProducer;
|
||||||
|
|
||||||
typedef ::moodycamel::ProducerToken producer_token_t;
|
typedef moodycamel::ProducerToken producer_token_t;
|
||||||
typedef ::moodycamel::ConsumerToken consumer_token_t;
|
typedef moodycamel::ConsumerToken consumer_token_t;
|
||||||
|
|
||||||
typedef typename Traits::index_t index_t;
|
typedef typename Traits::index_t index_t;
|
||||||
typedef typename Traits::size_t size_t;
|
typedef typename Traits::size_t size_t;
|
||||||
@ -3671,6 +3674,8 @@ inline void swap(typename ConcurrentQueue<T, Traits>::ImplicitProducerKVP& a, ty
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* namespace tracy */
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user