Store count of proper and inline symbols in trace dump.

This commit is contained in:
Bartosz Taudul 2020-04-08 12:49:58 +02:00
parent 1da1d31e1c
commit 2a06f1545b
2 changed files with 51 additions and 15 deletions

View File

@ -7,7 +7,7 @@ namespace Version
{ {
enum { Major = 0 }; enum { Major = 0 };
enum { Minor = 6 }; enum { Minor = 6 };
enum { Patch = 10 }; enum { Patch = 11 };
} }
} }

View File

@ -1686,6 +1686,37 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
} }
if( fileVer >= FileVersion( 0, 6, 7 ) ) if( fileVer >= FileVersion( 0, 6, 7 ) )
{
if( fileVer >= FileVersion( 0, 6, 11 ) )
{
f.Read( sz );
m_data.symbolLoc.reserve_exact( sz, m_slab );
f.Read( sz );
m_data.symbolLocInline.reserve_exact( sz, m_slab );
f.Read( sz );
m_data.symbolMap.reserve( sz );
int symIdx = 0;
int symInlineIdx = 0;
for( uint64_t i=0; i<sz; i++ )
{
uint64_t symAddr;
StringIdx name, file, imageName, callFile;
uint32_t line, callLine;
uint8_t isInline;
Int24 size;
f.Read9( symAddr, name, file, line, imageName, callFile, callLine, isInline, size );
m_data.symbolMap.emplace( symAddr, SymbolData { name, file, line, imageName, callFile, callLine, isInline, size } );
if( isInline )
{
m_data.symbolLocInline[symInlineIdx++] = symAddr;
}
else
{
m_data.symbolLoc[symIdx++] = SymbolLocation { symAddr, size.Val() };
}
}
}
else
{ {
f.Read( sz ); f.Read( sz );
m_data.symbolMap.reserve( sz ); m_data.symbolMap.reserve( sz );
@ -1707,6 +1738,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } ); m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } );
} }
} }
}
#ifdef NO_PARALLEL_SORT #ifdef NO_PARALLEL_SORT
pdqsort_branchless( m_data.symbolLoc.begin(), m_data.symbolLoc.end(), [] ( const auto& l, const auto& r ) { return l.addr < r.addr; } ); pdqsort_branchless( m_data.symbolLoc.begin(), m_data.symbolLoc.end(), [] ( const auto& l, const auto& r ) { return l.addr < r.addr; } );
pdqsort_branchless( m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() ); pdqsort_branchless( m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() );
@ -7018,6 +7050,10 @@ void Worker::Write( FileWrite& f )
f.Write( &v.second, sizeof( v.second ) ); f.Write( &v.second, sizeof( v.second ) );
} }
sz = m_data.symbolLoc.size();
f.Write( &sz, sizeof( sz ) );
sz = m_data.symbolLocInline.size();
f.Write( &sz, sizeof( sz ) );
sz = m_data.symbolMap.size(); sz = m_data.symbolMap.size();
f.Write( &sz, sizeof( sz ) ); f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.symbolMap ) for( auto& v : m_data.symbolMap )