Fix no statistics build.

This commit is contained in:
Bartosz Taudul 2020-02-29 19:31:51 +01:00
parent de3a48f958
commit 8d5755521e
2 changed files with 10 additions and 2 deletions

View File

@ -2526,7 +2526,6 @@ void Worker::Exec()
const char* ptr = m_buffer + netbuf.bufferOffset;
const char* end = ptr + netbuf.size;
m_data.newFramesWereReceived = false;
{
std::lock_guard<std::shared_mutex> lock( m_data.lock );
@ -2547,7 +2546,10 @@ void Worker::Exec()
}
HandlePostponedPlots();
#ifndef TRACY_NO_STATISTICS
HandlePostponedSamples();
m_data.newFramesWereReceived = false;
#endif
while( !m_serverQueryQueue.empty() && m_serverQuerySpaceLeft > 0 )
{
@ -3355,6 +3357,7 @@ void Worker::HandlePostponedPlots()
}
}
#ifndef TRACY_NO_STATISTICS
void Worker::HandlePostponedSamples()
{
if( !m_data.newFramesWereReceived ) return;
@ -3366,6 +3369,7 @@ void Worker::HandlePostponedSamples()
}
while( it != m_data.postponedSamples.end() );
}
#endif
StringLocation Worker::StoreString( const char* str, size_t sz )
{
@ -4784,7 +4788,9 @@ void Worker::ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev )
assert( m_pendingCallstackFrames > 0 );
m_pendingCallstackFrames--;
m_pendingCallstackSubframes = ev.size;
#ifndef TRACY_NO_STATISTICS
m_data.newFramesWereReceived = true;
#endif
auto iit = m_pendingCustomStrings.find( ev.imageName );
assert( iit != m_pendingCustomStrings.end() );

View File

@ -361,9 +361,11 @@ public:
bool HasContextSwitches() const { return !m_data.ctxSwitch.empty(); }
uint64_t GetSrcLocCount() const { return m_data.sourceLocationPayload.size() + m_data.sourceLocation.size(); }
uint64_t GetCallstackPayloadCount() const { return m_data.callstackPayload.size() - 1; }
#ifndef TRACY_NO_STATISTICS
uint64_t GetCallstackParentPayloadCount() const { return m_data.parentCallstackPayload.size(); }
uint64_t GetCallstackFrameCount() const { return m_data.callstackFrameMap.size(); }
uint64_t GetCallstackParentFrameCount() const { return m_callstackParentNextIdx; }
#endif
uint64_t GetCallstackFrameCount() const { return m_data.callstackFrameMap.size(); }
uint64_t GetCallstackSampleCount() const { return m_data.samplesCnt; }
uint64_t GetSymbolsCount() const { return m_data.symbolMap.size(); }
uint32_t GetFrameImageCount() const { return (uint32_t)m_data.frameImage.size(); }