No need to remember addresses of symbol code queries.

This commit is contained in:
Bartosz Taudul 2021-11-25 22:35:43 +01:00
parent b4da047355
commit abdd6020ba
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 6 additions and 7 deletions

View File

@ -272,6 +272,7 @@ Worker::Worker( const char* addr, uint16_t port )
, m_pendingCallstackFrames( 0 ) , m_pendingCallstackFrames( 0 )
, m_pendingCallstackSubframes( 0 ) , m_pendingCallstackSubframes( 0 )
, m_pendingCodeInformation( 0 ) , m_pendingCodeInformation( 0 )
, m_pendingSymbolCode( 0 )
, m_callstackFrameStaging( nullptr ) , m_callstackFrameStaging( nullptr )
, m_traceVersion( CurrentVersion ) , m_traceVersion( CurrentVersion )
, m_loadTime( 0 ) , m_loadTime( 0 )
@ -3159,7 +3160,7 @@ void Worker::Exec()
if( m_pendingStrings != 0 || m_pendingThreads != 0 || m_pendingSourceLocation != 0 || m_pendingCallstackFrames != 0 || if( m_pendingStrings != 0 || m_pendingThreads != 0 || m_pendingSourceLocation != 0 || m_pendingCallstackFrames != 0 ||
m_data.plots.IsPending() || m_pendingCallstackId != 0 || m_pendingExternalNames != 0 || m_data.plots.IsPending() || m_pendingCallstackId != 0 || m_pendingExternalNames != 0 ||
m_pendingCallstackSubframes != 0 || m_pendingFrameImageData.image != nullptr || !m_pendingSymbols.empty() || m_pendingCallstackSubframes != 0 || m_pendingFrameImageData.image != nullptr || !m_pendingSymbols.empty() ||
!m_pendingSymbolCode.empty() || m_pendingCodeInformation != 0 || !m_serverQueryQueue.empty() || m_pendingSymbolCode != 0 || m_pendingCodeInformation != 0 || !m_serverQueryQueue.empty() ||
m_pendingSourceLocationPayload != 0 || m_pendingSingleString.ptr != nullptr || m_pendingSecondString.ptr != nullptr || m_pendingSourceLocationPayload != 0 || m_pendingSingleString.ptr != nullptr || m_pendingSecondString.ptr != nullptr ||
!m_sourceCodeQuery.empty() || m_pendingFibers != 0 ) !m_sourceCodeQuery.empty() || m_pendingFibers != 0 )
{ {
@ -4046,9 +4047,8 @@ void Worker::AddFrameImageData( uint64_t ptr, const char* data, size_t sz )
void Worker::AddSymbolCode( uint64_t ptr, const char* data, size_t sz ) void Worker::AddSymbolCode( uint64_t ptr, const char* data, size_t sz )
{ {
auto it = m_pendingSymbolCode.find( ptr ); assert( m_pendingSymbolCode > 0 );
assert( it != m_pendingSymbolCode.end() ); m_pendingSymbolCode--;
m_pendingSymbolCode.erase( it );
auto code = (char*)m_slab.AllocBig( sz ); auto code = (char*)m_slab.AllocBig( sz );
memcpy( code, data, sz ); memcpy( code, data, sz );
@ -6608,8 +6608,7 @@ void Worker::ProcessSymbolInformation( const QueueSymbolInformation& ev )
if( m_codeTransfer && it->second.size > 0 && it->second.size <= 128*1024 ) if( m_codeTransfer && it->second.size > 0 && it->second.size <= 128*1024 )
{ {
assert( m_pendingSymbolCode.find( ev.symAddr ) == m_pendingSymbolCode.end() ); m_pendingSymbolCode++;
m_pendingSymbolCode.emplace( ev.symAddr );
Query( ServerQuerySymbolCode, ev.symAddr, it->second.size ); Query( ServerQuerySymbolCode, ev.symAddr, it->second.size );
} }

View File

@ -927,7 +927,6 @@ private:
unordered_flat_map<uint64_t, ThreadData*> m_threadMap; unordered_flat_map<uint64_t, ThreadData*> m_threadMap;
FrameImagePending m_pendingFrameImageData = {}; FrameImagePending m_pendingFrameImageData = {};
unordered_flat_map<uint64_t, SymbolPending> m_pendingSymbols; unordered_flat_map<uint64_t, SymbolPending> m_pendingSymbols;
unordered_flat_set<uint64_t> m_pendingSymbolCode;
unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_pendingFileStrings; unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_pendingFileStrings;
unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_checkedFileStrings; unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_checkedFileStrings;
StringLocation m_pendingSingleString = {}; StringLocation m_pendingSingleString = {};
@ -941,6 +940,7 @@ private:
uint32_t m_pendingCallstackFrames; uint32_t m_pendingCallstackFrames;
uint8_t m_pendingCallstackSubframes; uint8_t m_pendingCallstackSubframes;
uint32_t m_pendingCodeInformation; uint32_t m_pendingCodeInformation;
uint32_t m_pendingSymbolCode;
CallstackFrameData* m_callstackFrameStaging; CallstackFrameData* m_callstackFrameStaging;
uint64_t m_callstackFrameStagingPtr; uint64_t m_callstackFrameStagingPtr;