mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01:48 +00:00
Send single string for code information.
This commit is contained in:
parent
81d5a8db5e
commit
14b180cd16
@ -2897,12 +2897,11 @@ void Profiler::SendCodeLocation( uint64_t ptr )
|
|||||||
#ifdef TRACY_HAS_CALLSTACK
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
const auto sym = DecodeCodeAddress( ptr );
|
const auto sym = DecodeCodeAddress( ptr );
|
||||||
|
|
||||||
SendString( uint64_t( sym.file ), sym.file, QueueType::CustomStringData );
|
SendSingleString( sym.file );
|
||||||
|
|
||||||
QueueItem item;
|
QueueItem item;
|
||||||
MemWrite( &item.hdr.type, QueueType::CodeInformation );
|
MemWrite( &item.hdr.type, QueueType::CodeInformation );
|
||||||
MemWrite( &item.codeInformation.ptr, ptr );
|
MemWrite( &item.codeInformation.ptr, ptr );
|
||||||
MemWrite( &item.codeInformation.file, uint64_t( sym.file ) );
|
|
||||||
MemWrite( &item.codeInformation.line, sym.line );
|
MemWrite( &item.codeInformation.line, sym.line );
|
||||||
|
|
||||||
AppendData( &item, QueueDataSize[(int)QueueType::CodeInformation] );
|
AppendData( &item, QueueDataSize[(int)QueueType::CodeInformation] );
|
||||||
|
@ -401,7 +401,6 @@ struct QueueSymbolInformation
|
|||||||
struct QueueCodeInformation
|
struct QueueCodeInformation
|
||||||
{
|
{
|
||||||
uint64_t ptr;
|
uint64_t ptr;
|
||||||
uint64_t file;
|
|
||||||
uint32_t line;
|
uint32_t line;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5548,13 +5548,14 @@ void Worker::ProcessCodeInformation( const QueueCodeInformation& ev )
|
|||||||
assert( m_pendingCodeInformation > 0 );
|
assert( m_pendingCodeInformation > 0 );
|
||||||
m_pendingCodeInformation--;
|
m_pendingCodeInformation--;
|
||||||
|
|
||||||
auto fit = m_pendingCustomStrings.find( ev.file );
|
assert( m_pendingSingleString.ptr != nullptr );
|
||||||
assert( fit != m_pendingCustomStrings.end() );
|
const auto idx = m_pendingSingleString.idx;
|
||||||
|
m_pendingSingleString.ptr = nullptr;
|
||||||
|
|
||||||
if( ev.line != 0 )
|
if( ev.line != 0 )
|
||||||
{
|
{
|
||||||
assert( m_data.codeAddressToLocation.find( ev.ptr ) == m_data.codeAddressToLocation.end() );
|
assert( m_data.codeAddressToLocation.find( ev.ptr ) == m_data.codeAddressToLocation.end() );
|
||||||
const auto packed = PackFileLine( fit->second.idx, ev.line );
|
const auto packed = PackFileLine( idx, ev.line );
|
||||||
m_data.codeAddressToLocation.emplace( ev.ptr, packed );
|
m_data.codeAddressToLocation.emplace( ev.ptr, packed );
|
||||||
|
|
||||||
auto lit = m_data.locationCodeAddressList.find( packed );
|
auto lit = m_data.locationCodeAddressList.find( packed );
|
||||||
@ -5569,12 +5570,10 @@ void Worker::ProcessCodeInformation( const QueueCodeInformation& ev )
|
|||||||
if( needSort ) pdqsort_branchless( lit->second.begin(), lit->second.end() );
|
if( needSort ) pdqsort_branchless( lit->second.begin(), lit->second.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
StringRef ref( StringRef::Idx, fit->second.idx );
|
StringRef ref( StringRef::Idx, idx );
|
||||||
auto cit = m_checkedFileStrings.find( ref );
|
auto cit = m_checkedFileStrings.find( ref );
|
||||||
if( cit == m_checkedFileStrings.end() ) CacheSource( ref );
|
if( cit == m_checkedFileStrings.end() ) CacheSource( ref );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pendingCustomStrings.erase( fit );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Worker::ProcessCrashReport( const QueueCrashReport& ev )
|
void Worker::ProcessCrashReport( const QueueCrashReport& ev )
|
||||||
|
Loading…
Reference in New Issue
Block a user