Drop support for pre-0.9.0 traces.

This commit is contained in:
Bartosz Taudul 2024-01-02 20:08:41 +01:00
parent 90c7a43e8a
commit fc8fc80900
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -61,7 +61,7 @@ static bool SourceFileValid( const char* fn, uint64_t olderThan )
static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', Version::Major, Version::Minor, Version::Patch }; static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', Version::Major, Version::Minor, Version::Patch };
enum { FileHeaderMagic = 5 }; enum { FileHeaderMagic = 5 };
static const int CurrentVersion = FileVersion( Version::Major, Version::Minor, Version::Patch ); static const int CurrentVersion = FileVersion( Version::Major, Version::Minor, Version::Patch );
static const int MinSupportedVersion = FileVersion( 0, 8, 0 ); static const int MinSupportedVersion = FileVersion( 0, 9, 0 );
static void UpdateLockCountLockable( LockMap& lockmap, size_t pos ) static void UpdateLockCountLockable( LockMap& lockmap, size_t pos )
@ -1096,76 +1096,34 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks, bool allow
{ {
m_data.plots.Data().reserve( sz ); m_data.plots.Data().reserve( sz );
s_loadProgress.subTotal.store( sz, std::memory_order_relaxed ); s_loadProgress.subTotal.store( sz, std::memory_order_relaxed );
if( fileVer >= FileVersion( 0, 8, 3 ) ) for( uint64_t i=0; i<sz; i++ )
{ {
for( uint64_t i=0; i<sz; i++ ) s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
auto pd = m_slab.AllocInit<PlotData>();
uint64_t psz;
f.Read10( pd->type, pd->format, pd->showSteps, pd->fill, pd->color, pd->name, pd->min, pd->max, pd->sum, psz );
pd->data.reserve_exact( psz, m_slab );
auto ptr = pd->data.data();
int64_t refTime = 0;
for( uint64_t j=0; j<psz; j++ )
{ {
s_loadProgress.subProgress.store( i, std::memory_order_relaxed ); int64_t t;
auto pd = m_slab.AllocInit<PlotData>(); f.Read2( t, ptr->val );
uint64_t psz; refTime += t;
f.Read10( pd->type, pd->format, pd->showSteps, pd->fill, pd->color, pd->name, pd->min, pd->max, pd->sum, psz ); ptr->time = refTime;
pd->data.reserve_exact( psz, m_slab ); ptr++;
auto ptr = pd->data.data();
int64_t refTime = 0;
for( uint64_t j=0; j<psz; j++ )
{
int64_t t;
f.Read2( t, ptr->val );
refTime += t;
ptr->time = refTime;
ptr++;
}
m_data.plots.Data().push_back_no_space_check( pd );
}
}
else
{
for( uint64_t i=0; i<sz; i++ )
{
s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
auto pd = m_slab.AllocInit<PlotData>();
uint64_t psz;
f.Read7( pd->type, pd->format, pd->name, pd->min, pd->max, pd->sum, psz );
pd->showSteps = false;
pd->fill = true;
pd->color = 0;
pd->data.reserve_exact( psz, m_slab );
auto ptr = pd->data.data();
int64_t refTime = 0;
for( uint64_t j=0; j<psz; j++ )
{
int64_t t;
f.Read2( t, ptr->val );
refTime += t;
ptr->time = refTime;
ptr++;
}
m_data.plots.Data().push_back_no_space_check( pd );
} }
m_data.plots.Data().push_back_no_space_check( pd );
} }
} }
else else
{ {
if( fileVer >= FileVersion( 0, 8, 3 ) ) for( uint64_t i=0; i<sz; i++ )
{ {
for( uint64_t i=0; i<sz; i++ ) f.Skip( sizeof( PlotData::name ) + sizeof( PlotData::min ) + sizeof( PlotData::max ) + sizeof( PlotData::sum ) + sizeof( PlotData::type ) + sizeof( PlotData::format ) + sizeof( PlotData::showSteps ) + sizeof( PlotData::fill ) + sizeof( PlotData::color ) );
{ uint64_t psz;
f.Skip( sizeof( PlotData::name ) + sizeof( PlotData::min ) + sizeof( PlotData::max ) + sizeof( PlotData::sum ) + sizeof( PlotData::type ) + sizeof( PlotData::format ) + sizeof( PlotData::showSteps ) + sizeof( PlotData::fill ) + sizeof( PlotData::color ) ); f.Read( psz );
uint64_t psz; f.Skip( psz * ( sizeof( uint64_t ) + sizeof( double ) ) );
f.Read( psz );
f.Skip( psz * ( sizeof( uint64_t ) + sizeof( double ) ) );
}
}
else
{
for( uint64_t i=0; i<sz; i++ )
{
f.Skip( sizeof( PlotData::name ) + sizeof( PlotData::min ) + sizeof( PlotData::max ) + sizeof( PlotData::sum ) + sizeof( PlotData::type ) + sizeof( PlotData::format ) );
uint64_t psz;
f.Read( psz );
f.Skip( psz * ( sizeof( uint64_t ) + sizeof( double ) ) );
}
} }
} }
@ -1597,37 +1555,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks, bool allow
} }
} }
if( fileVer <= FileVersion( 0, 8, 4 ) )
{
f.Read( sz );
for( uint64_t i=0; i<sz; i++ )
{
uint64_t packed;
uint16_t lsz;
f.Read2( packed, lsz );
uint32_t line;
const auto fidx = UnpackFileLine( packed, line );
uint64_t ref = 0;
for( uint16_t j=0; j<lsz; j++ )
{
uint64_t diff;
f.Read( diff );
ref += diff;
auto frameId = PackPointer( ref );
if( m_data.callstackFrameMap.find( frameId ) == m_data.callstackFrameMap.end() )
{
auto cs = m_slab.AllocInit<CallstackFrameData>();
cs->size = 1;
cs->data = m_slab.AllocInit<CallstackFrame>( 1 );
cs->data->file = StringIdx( fidx );
cs->data->line = line;
cs->data->symAddr = 0;
m_data.callstackFrameMap.emplace( frameId, cs );
}
}
}
}
f.Read( sz ); f.Read( sz );
m_data.codeSymbolMap.reserve( sz ); m_data.codeSymbolMap.reserve( sz );
for( uint64_t i=0; i<sz; i++ ) for( uint64_t i=0; i<sz; i++ )