MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / DequeueSerial

Method DequeueSerial

Dependencies/tracy/client/TracyProfiler.cpp:2717–3020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2715 }
2716
2717Profiler::DequeueStatus Profiler::DequeueSerial()
2718{
2719 {
2720 bool lockHeld = true;
2721 while( !m_serialLock.try_lock() )
2722 {
2723 if( m_shutdownManual.load( std::memory_order_relaxed ) )
2724 {
2725 lockHeld = false;
2726 break;
2727 }
2728 }
2729 if( !m_serialQueue.empty() ) m_serialQueue.swap( m_serialDequeue );
2730 if( lockHeld )
2731 {
2732 m_serialLock.unlock();
2733 }
2734 }
2735
2736 const auto sz = m_serialDequeue.size();
2737 if( sz > 0 )
2738 {
2739 InitRpmalloc();
2740 int64_t refSerial = m_refTimeSerial;
2741 int64_t refGpu = m_refTimeGpu;
2742#ifdef TRACY_FIBERS
2743 int64_t refThread = m_refTimeThread;
2744#endif
2745 auto item = m_serialDequeue.data();
2746 auto end = item + sz;
2747 while( item != end )
2748 {
2749 uint64_t ptr;
2750 auto idx = MemRead<uint8_t>( &item->hdr.idx );
2751 if( idx < (int)QueueType::Terminate )
2752 {
2753 switch( (QueueType)idx )
2754 {
2755 case QueueType::CallstackSerial:
2756 ptr = MemRead<uint64_t>( &item->callstackFat.ptr );
2757 SendCallstackPayload( ptr );
2758 tracy_free_fast( (void*)ptr );
2759 break;
2760 case QueueType::LockWait:
2761 case QueueType::LockSharedWait:
2762 {
2763 int64_t t = MemRead<int64_t>( &item->lockWait.time );
2764 int64_t dt = t - refSerial;
2765 refSerial = t;
2766 MemWrite( &item->lockWait.time, dt );
2767 break;
2768 }
2769 case QueueType::LockObtain:
2770 case QueueType::LockSharedObtain:
2771 {
2772 int64_t t = MemRead<int64_t>( &item->lockObtain.time );
2773 int64_t dt = t - refSerial;
2774 refSerial = t;

Callers

nothing calls this directly

Calls 10

tracy_free_fastFunction · 0.85
MemWriteFunction · 0.85
InitRpmallocFunction · 0.70
try_lockMethod · 0.45
loadMethod · 0.45
emptyMethod · 0.45
swapMethod · 0.45
unlockMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected