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

@ -1687,24 +1687,56 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
if( fileVer >= FileVersion( 0, 6, 7 ) ) if( fileVer >= FileVersion( 0, 6, 7 ) )
{ {
f.Read( sz ); if( fileVer >= FileVersion( 0, 6, 11 ) )
m_data.symbolMap.reserve( sz );
for( uint64_t i=0; i<sz; i++ )
{ {
uint64_t symAddr; f.Read( sz );
StringIdx name, file, imageName, callFile; m_data.symbolLoc.reserve_exact( sz, m_slab );
uint32_t line, callLine; f.Read( sz );
uint8_t isInline; m_data.symbolLocInline.reserve_exact( sz, m_slab );
Int24 size; f.Read( sz );
f.Read9( symAddr, name, file, line, imageName, callFile, callLine, isInline, size ); m_data.symbolMap.reserve( sz );
m_data.symbolMap.emplace( symAddr, SymbolData { name, file, line, imageName, callFile, callLine, isInline, size } ); int symIdx = 0;
if( isInline ) int symInlineIdx = 0;
for( uint64_t i=0; i<sz; i++ )
{ {
m_data.symbolLocInline.push_back( symAddr ); 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 }
else
{
f.Read( sz );
m_data.symbolMap.reserve( sz );
for( uint64_t i=0; i<sz; i++ )
{ {
m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } ); 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.push_back( symAddr );
}
else
{
m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } );
}
} }
} }
#ifdef NO_PARALLEL_SORT #ifdef NO_PARALLEL_SORT
@ -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 )