Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-28 01:14:06 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-28 01:14:06 +0300
commitbae7fb3e882838ae49d5843284eed6064f75cfd8 (patch)
treef4a522a3fbd433968466883949d0e1b726db1753
parent96c6898da32efc1835afbaede6643578f4b5c73f (diff)
Drop support for 0.7.x traces.
-rw-r--r--server/TracyWorker.cpp429
1 files changed, 102 insertions, 327 deletions
diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp
index fd04ab8a..7faed90e 100644
--- a/server/TracyWorker.cpp
+++ b/server/TracyWorker.cpp
@@ -58,7 +58,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 };
enum { FileHeaderMagic = 5 };
static const int CurrentVersion = FileVersion( Version::Major, Version::Minor, Version::Patch );
-static const int MinSupportedVersion = FileVersion( 0, 7, 0 );
+static const int MinSupportedVersion = FileVersion( 0, 8, 0 );
static void UpdateLockCountLockable( LockMap& lockmap, size_t pos )
@@ -606,14 +606,9 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_captureProgram = std::string( tmp, tmp+sz );
f.Read( m_captureTime );
}
- if( fileVer >= FileVersion( 0, 7, 6 ) )
- {
- f.Read( m_executableTime );
- }
- else
- {
- m_executableTime = 0;
- }
+
+ f.Read( m_executableTime );
+
{
f.Read( sz );
assert( sz < 1024 );
@@ -792,18 +787,15 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
status.first->second.zones.reserve( cnt );
}
- if( fileVer >= FileVersion( 0, 7, 15 ) )
+ f.Read( sz );
+ for( uint64_t i=0; i<sz; i++ )
{
- f.Read( sz );
- for( uint64_t i=0; i<sz; i++ )
- {
- int16_t id;
- uint64_t cnt;
- f.Read2( id, cnt );
- auto status = m_data.gpuSourceLocationZones.emplace( id, GpuSourceLocationZones() );
- assert( status.second );
- status.first->second.zones.reserve( cnt );
- }
+ int16_t id;
+ uint64_t cnt;
+ f.Read2( id, cnt );
+ auto status = m_data.gpuSourceLocationZones.emplace( id, GpuSourceLocationZones() );
+ assert( status.second );
+ status.first->second.zones.reserve( cnt );
}
#else
f.Read( sz );
@@ -815,16 +807,13 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_data.sourceLocationZonesCnt.emplace( id, 0 );
}
- if( fileVer >= FileVersion( 0, 7, 15 ) )
+ f.Read( sz );
+ for( uint64_t i=0; i<sz; i++ )
{
- f.Read( sz );
- for( uint64_t i=0; i<sz; i++ )
- {
- int16_t id;
- f.Read( id );
- f.Skip( sizeof( uint64_t ) );
- m_data.gpuSourceLocationZonesCnt.emplace( id, 0 );
- }
+ int16_t id;
+ f.Read( id );
+ f.Skip( sizeof( uint64_t ) );
+ m_data.gpuSourceLocationZonesCnt.emplace( id, 0 );
}
#endif
@@ -929,25 +918,10 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) + sizeof( MessageData::color ) + sizeof( MessageData::callstack ) ) );
}
- if( fileVer >= FileVersion( 0, 7, 5 ) )
- {
- f.Read( sz );
- assert( sz != 0 );
- m_data.zoneExtra.reserve_exact( sz, m_slab );
- f.Read( m_data.zoneExtra.data(), sz * sizeof( ZoneExtra ) );
- }
- else
- {
- f.Read( sz );
- assert( sz != 0 );
- m_data.zoneExtra.reserve_exact( sz, m_slab );
- for( uint64_t i=0; i<sz; i++ )
- {
- auto* zoneExtra = &m_data.zoneExtra[i];
- f.Read3( zoneExtra->callstack, zoneExtra->text, zoneExtra->name );
- zoneExtra->color = 0;
- }
- }
+ f.Read( sz );
+ assert( sz != 0 );
+ m_data.zoneExtra.reserve_exact( sz, m_slab );
+ f.Read( m_data.zoneExtra.data(), sz * sizeof( ZoneExtra ) );
s_loadProgress.progress.store( LoadProgress::Zones, std::memory_order_relaxed );
f.Read( sz );
@@ -963,21 +937,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
{
auto td = m_slab.AllocInit<ThreadData>();
uint64_t tid;
- if( fileVer >= FileVersion( 0, 7, 11 ) )
- {
- f.Read4( tid, td->count, td->kernelSampleCnt, td->isFiber );
- }
- else if( fileVer >= FileVersion( 0, 7, 9 ) )
- {
- f.Read3( tid, td->count, td->kernelSampleCnt );
- td->isFiber = 0;
- }
- else
- {
- f.Read2( tid, td->count );
- td->kernelSampleCnt = 0;
- td->isFiber = 0;
- }
+ f.Read4( tid, td->count, td->kernelSampleCnt, td->isFiber );
td->id = tid;
m_data.zonesCnt += td->count;
uint32_t tsz;
@@ -1005,31 +965,27 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
{
f.Skip( msz * sizeof( uint64_t ) );
}
- if( fileVer >= FileVersion( 0, 7, 14 ) )
+ uint64_t ssz;
+ f.Read( ssz );
+ if( ssz != 0 )
{
- uint64_t ssz;
- f.Read( ssz );
- if( ssz != 0 )
+ if( eventMask & EventType::Samples )
{
- if( eventMask & EventType::Samples )
- {
- int64_t refTime = 0;
- td->ctxSwitchSamples.reserve_exact( ssz, m_slab );
- auto ptr = td->ctxSwitchSamples.data();
- for( uint64_t j=0; j<ssz; j++ )
- {
- ptr->time.SetVal( ReadTimeOffset( f, refTime ) );
- f.Read( &ptr->callstack, sizeof( ptr->callstack ) );
- ptr++;
- }
- }
- else
+ int64_t refTime = 0;
+ td->ctxSwitchSamples.reserve_exact( ssz, m_slab );
+ auto ptr = td->ctxSwitchSamples.data();
+ for( uint64_t j=0; j<ssz; j++ )
{
- f.Skip( ssz * ( 8 + 3 ) );
+ ptr->time.SetVal( ReadTimeOffset( f, refTime ) );
+ f.Read( &ptr->callstack, sizeof( ptr->callstack ) );
+ ptr++;
}
}
+ else
+ {
+ f.Skip( ssz * ( 8 + 3 ) );
+ }
}
- uint64_t ssz;
f.Read( ssz );
if( ssz != 0 )
{
@@ -1068,33 +1024,9 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
for( uint64_t i=0; i<sz; i++ )
{
auto ctx = m_slab.AllocInit<GpuCtxData>();
- if( fileVer >= FileVersion( 0, 7, 9 ) )
- {
- uint8_t calibration;
- f.Read7( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name, ctx->overflow );
- ctx->hasCalibration = calibration;
- }
- else if( fileVer >= FileVersion( 0, 7, 6 ) )
- {
- uint8_t calibration;
- f.Read6( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name );
- ctx->hasCalibration = calibration;
- ctx->overflow = 0;
- }
- else if( fileVer >= FileVersion( 0, 7, 1 ) )
- {
- uint8_t calibration;
- f.Read5( ctx->thread, calibration, ctx->count, ctx->period, ctx->type );
- ctx->hasCalibration = calibration;
- ctx->overflow = 0;
- }
- else
- {
- uint8_t accuracy;
- f.Read5( ctx->thread, accuracy, ctx->count, ctx->period, ctx->type );
- ctx->hasCalibration = false;
- ctx->overflow = 0;
- }
+ uint8_t calibration;
+ f.Read7( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name, ctx->overflow );
+ ctx->hasCalibration = calibration;
ctx->hasPeriod = ctx->period != 1.f;
m_data.gpuCnt += ctx->count;
uint64_t tdsz;
@@ -1142,31 +1074,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_data.plots.Data().push_back_no_space_check( pd );
}
}
- else if( fileVer >= FileVersion( 0, 7, 10 ) )
- {
- 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 );
- }
- }
else
{
for( uint64_t i=0; i<sz; i++ )
@@ -1174,8 +1081,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
auto pd = m_slab.AllocInit<PlotData>();
uint64_t psz;
- f.Read6( pd->type, pd->format, pd->name, pd->min, pd->max, psz );
- pd->sum = 0;
+ f.Read7( pd->type, pd->format, pd->name, pd->min, pd->max, pd->sum, psz );
pd->showSteps = false;
pd->fill = true;
pd->color = 0;
@@ -1186,7 +1092,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
{
int64_t t;
f.Read2( t, ptr->val );
- pd->sum += ptr->val;
refTime += t;
ptr->time = refTime;
ptr++;
@@ -1208,21 +1113,11 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
}
}
- else if( fileVer >= FileVersion( 0, 7, 10 ) )
- {
- 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 ) ) );
- }
- }
else
{
for( uint64_t i=0; i<sz; i++ )
{
- f.Skip( sizeof( PlotData::name ) + sizeof( PlotData::min ) + sizeof( PlotData::max ) + sizeof( PlotData::type ) + sizeof( PlotData::format ) );
+ 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 ) ) );
@@ -1233,83 +1128,19 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
s_loadProgress.subTotal.store( 0, std::memory_order_relaxed );
s_loadProgress.progress.store( LoadProgress::Memory, std::memory_order_relaxed );
- if( fileVer >= FileVersion( 0, 7, 3 ) )
- {
- uint64_t memcount, memtarget, memload = 0;
- f.Read2( memcount, memtarget );
- s_loadProgress.subTotal.store( memtarget, std::memory_order_relaxed );
-
- for( uint64_t k=0; k<memcount; k++ )
- {
- uint64_t memname;
- f.Read2( memname, sz );
- if( eventMask & EventType::Memory )
- {
- auto mit = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() );
- if( memname == 0 ) m_data.memory = mit.first->second;
- auto& memdata = *mit.first->second;
- memdata.data.reserve_exact( sz, m_slab );
- uint64_t activeSz, freesSz;
- f.Read2( activeSz, freesSz );
- memdata.active.reserve( activeSz );
- memdata.frees.reserve_exact( freesSz, m_slab );
- auto mem = memdata.data.data();
- s_loadProgress.subTotal.store( sz, std::memory_order_relaxed );
- size_t fidx = 0;
- int64_t refTime = 0;
- auto& frees = memdata.frees;
- auto& active = memdata.active;
-
- for( uint64_t i=0; i<sz; i++ )
- {
- s_loadProgress.subProgress.store( memload+i, std::memory_order_relaxed );
- uint64_t ptr, size;
- Int24 csAlloc;
- int64_t timeAlloc, timeFree;
- uint16_t threadAlloc, threadFree;
- f.Read8( ptr, size, csAlloc, mem->csFree, timeAlloc, timeFree, threadAlloc, threadFree );
- mem->SetPtr( ptr );
- mem->SetSize( size );
- mem->SetCsAlloc( csAlloc.Val() );
- refTime += timeAlloc;
- mem->SetTimeThreadAlloc( refTime, threadAlloc );
- if( timeFree >= 0 )
- {
- mem->SetTimeThreadFree( timeFree + refTime, threadFree );
- frees[fidx++] = i;
- }
- else
- {
- mem->SetTimeThreadFree( timeFree, threadFree );
- active.emplace( ptr, i );
- }
- mem++;
- }
- memload += sz;
- f.Read4( memdata.high, memdata.low, memdata.usage, memdata.name );
+ uint64_t memcount, memtarget, memload = 0;
+ f.Read2( memcount, memtarget );
+ s_loadProgress.subTotal.store( memtarget, std::memory_order_relaxed );
- if( sz != 0 )
- {
- memdata.reconstruct = true;
- }
- }
- else
- {
- f.Skip( 2 * sizeof( uint64_t ) );
- f.Skip( sz * ( sizeof( uint64_t ) + sizeof( uint64_t ) + sizeof( Int24 ) + sizeof( Int24 ) + sizeof( int64_t ) * 2 + sizeof( uint16_t ) * 2 ) );
- f.Skip( sizeof( MemData::high ) + sizeof( MemData::low ) + sizeof( MemData::usage ) + sizeof( MemData::name ) );
- }
- }
- }
- else
+ for( uint64_t k=0; k<memcount; k++ )
{
- m_data.memory = m_slab.AllocInit<MemData>();
- m_data.memNameMap.emplace( 0, m_data.memory );
-
- f.Read( sz );
+ uint64_t memname;
+ f.Read2( memname, sz );
if( eventMask & EventType::Memory )
{
- auto& memdata = *m_data.memory;
+ auto mit = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() );
+ if( memname == 0 ) m_data.memory = mit.first->second;
+ auto& memdata = *mit.first->second;
memdata.data.reserve_exact( sz, m_slab );
uint64_t activeSz, freesSz;
f.Read2( activeSz, freesSz );
@@ -1324,7 +1155,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
for( uint64_t i=0; i<sz; i++ )
{
- s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
+ s_loadProgress.subProgress.store( memload+i, std::memory_order_relaxed );
uint64_t ptr, size;
Int24 csAlloc;
int64_t timeAlloc, timeFree;
@@ -1347,7 +1178,8 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
}
mem++;
}
- f.Read3( memdata.high, memdata.low, memdata.usage );
+ memload += sz;
+ f.Read4( memdata.high, memdata.low, memdata.usage, memdata.name );
if( sz != 0 )
{
@@ -1358,7 +1190,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
{
f.Skip( 2 * sizeof( uint64_t ) );
f.Skip( sz * ( sizeof( uint64_t ) + sizeof( uint64_t ) + sizeof( Int24 ) + sizeof( Int24 ) + sizeof( int64_t ) * 2 + sizeof( uint16_t ) * 2 ) );
- f.Skip( sizeof( MemData::high ) + sizeof( MemData::low ) + sizeof( MemData::usage ) );
+ f.Skip( sizeof( MemData::high ) + sizeof( MemData::low ) + sizeof( MemData::usage ) + sizeof( MemData::name ) );
}
}
@@ -1411,16 +1243,13 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
if( eventMask & EventType::FrameImages )
{
ZSTD_CDict* cdict = nullptr;
- if( fileVer >= FileVersion( 0, 7, 8 ) )
- {
- uint32_t dsz;
- f.Read( dsz );
- auto dict = new char[dsz];
- f.Read( dict, dsz );
- cdict = ZSTD_createCDict( dict, dsz, 3 );
- m_texcomp.SetDict( ZSTD_createDDict( dict, dsz ) );
- delete[] dict;
- }
+ uint32_t dsz;
+ f.Read( dsz );
+ auto dict = new char[dsz];
+ f.Read( dict, dsz );
+ cdict = ZSTD_createCDict( dict, dsz, 3 );
+ m_texcomp.SetDict( ZSTD_createDDict( dict, dsz ) );
+ delete[] dict;
f.Read( sz );
m_data.frameImage.reserve_exact( sz, m_slab );
@@ -1533,12 +1362,9 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
}
else
{
- if( fileVer >= FileVersion( 0, 7, 8 ) )
- {
- uint32_t dsz;
- f.Read( dsz );
- f.Skip( dsz );
- }
+ uint32_t dsz;
+ f.Read( dsz );
+ f.Skip( dsz );
f.Read( sz );
s_loadProgress.subTotal.store( sz, std::memory_order_relaxed );
for( uint64_t i=0; i<sz; i++ )
@@ -1573,43 +1399,21 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
int64_t runningTime = 0;
int64_t refTime = 0;
auto ptr = data->v.data();
- if( fileVer >= FileVersion( 0, 7, 12 ) )
- {
- for( uint64_t j=0; j<csz; j++ )
- {
- int64_t deltaWakeup, deltaStart, diff, thread;
- uint8_t cpu;
- int8_t reason, state;
- f.Read7( deltaWakeup, deltaStart, diff, cpu, reason, state, thread );
- refTime += deltaWakeup;
- ptr->SetWakeup( refTime );
- refTime += deltaStart;
- ptr->SetStartCpu( refTime, cpu );
- if( diff > 0 ) runningTime += diff;
- refTime += diff;
- ptr->SetEndReasonState( refTime, reason, state );
- ptr->SetThread( CompressThread( thread ) );
- ptr++;
- }
- }
- else
+ for( uint64_t j=0; j<csz; j++ )
{
- for( uint64_t j=0; j<csz; j++ )
- {
- int64_t deltaWakeup, deltaStart, diff;
- uint8_t cpu;
- int8_t reason, state;
- f.Read6( deltaWakeup, deltaStart, diff, cpu, reason, state );
- refTime += deltaWakeup;
- ptr->SetWakeup( refTime );
- refTime += deltaStart;
- ptr->SetStartCpu( refTime, cpu );
- if( diff > 0 ) runningTime += diff;
- refTime += diff;
- ptr->SetEndReasonState( refTime, reason, state );
- ptr->SetThread( 0 );
- ptr++;
- }
+ int64_t deltaWakeup, deltaStart, diff, thread;
+ uint8_t cpu;
+ int8_t reason, state;
+ f.Read7( deltaWakeup, deltaStart, diff, cpu, reason, state, thread );
+ refTime += deltaWakeup;
+ ptr->SetWakeup( refTime );
+ refTime += deltaStart;
+ ptr->SetStartCpu( refTime, cpu );
+ if( diff > 0 ) runningTime += diff;
+ refTime += diff;
+ ptr->SetEndReasonState( refTime, reason, state );
+ ptr->SetThread( CompressThread( thread ) );
+ ptr++;
}
data->runningTime = runningTime;
m_data.ctxSwitch.emplace( thread, data );
@@ -1625,14 +1429,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Skip( sizeof( uint64_t ) );
uint64_t csz;
f.Read( csz );
- if( fileVer >= FileVersion( 0, 7, 12 ) )
- {
- f.Skip( csz * ( sizeof( int64_t ) * 4 + sizeof( int8_t ) * 3 ) );
- }
- else
- {
- f.Skip( csz * ( sizeof( int64_t ) * 3 + sizeof( int8_t ) * 3 ) );
- }
+ f.Skip( csz * ( sizeof( int64_t ) * 4 + sizeof( int8_t ) * 3 ) );
}
}
@@ -1697,14 +1494,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Read( sz );
m_data.symbolLoc.reserve_exact( sz, m_slab );
f.Read( sz );
- if( fileVer < FileVersion( 0, 7, 2 ) )
- {
- m_data.symbolLocInline.reserve_exact( sz + 1, m_slab );
- }
- else
- {
- m_data.symbolLocInline.reserve_exact( sz, m_slab );
- }
+ m_data.symbolLocInline.reserve_exact( sz, m_slab );
f.Read( sz );
m_data.symbolMap.reserve( sz );
int symIdx = 0;
@@ -1727,10 +1517,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
m_data.symbolLoc[symIdx++] = SymbolLocation { symAddr, size.Val() };
}
}
- if( fileVer < FileVersion( 0, 7, 2 ) )
- {
- m_data.symbolLocInline[symInlineIdx] = std::numeric_limits<uint64_t>::max();
- }
#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.symbolLocInline.begin(), m_data.symbolLocInline.end() );
@@ -1798,31 +1584,28 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
}
}
- if( fileVer >= FileVersion( 0, 7, 9 ) )
+ f.Read( sz );
+ m_data.codeSymbolMap.reserve( sz );
+ for( uint64_t i=0; i<sz; i++ )
{
- f.Read( sz );
- m_data.codeSymbolMap.reserve( sz );
- for( uint64_t i=0; i<sz; i++ )
- {
- uint64_t v1, v2;
- f.Read2( v1, v2 );
- m_data.codeSymbolMap.emplace( v1, v2 );
- }
+ uint64_t v1, v2;
+ f.Read2( v1, v2 );
+ m_data.codeSymbolMap.emplace( v1, v2 );
+ }
- f.Read( sz );
- m_data.hwSamples.reserve( sz );
- for( uint64_t i=0; i<sz; i++ )
- {
- uint64_t addr;
- f.Read( addr );
- auto& data = m_data.hwSamples.emplace( addr, HwSampleData {} ).first->second;
- ReadHwSampleVec( f, data.cycles, m_slab );
- ReadHwSampleVec( f, data.retired, m_slab );
- ReadHwSampleVec( f, data.cacheRef, m_slab );
- ReadHwSampleVec( f, data.cacheMiss, m_slab );
- if( ReadHwSampleVec( f, data.branchRetired, m_slab ) != 0 ) m_data.hasBranchRetirement = true;
- ReadHwSampleVec( f, data.branchMiss, m_slab );
- }
+ f.Read( sz );
+ m_data.hwSamples.reserve( sz );
+ for( uint64_t i=0; i<sz; i++ )
+ {
+ uint64_t addr;
+ f.Read( addr );
+ auto& data = m_data.hwSamples.emplace( addr, HwSampleData {} ).first->second;
+ ReadHwSampleVec( f, data.cycles, m_slab );
+ ReadHwSampleVec( f, data.retired, m_slab );
+ ReadHwSampleVec( f, data.cacheRef, m_slab );
+ ReadHwSampleVec( f, data.cacheMiss, m_slab );
+ if( ReadHwSampleVec( f, data.branchRetired, m_slab ) != 0 ) m_data.hasBranchRetirement = true;
+ ReadHwSampleVec( f, data.branchMiss, m_slab );
}
f.Read( sz );
@@ -1865,14 +1648,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
{
m_backgroundDone.store( false, std::memory_order_relaxed );
#ifndef TRACY_NO_STATISTICS
- if( fileVer < FileVersion( 0, 7, 13 ) )
- {
- for( auto& t : m_data.threads )
- {
- pdqsort_branchless( t->samples.begin(), t->samples.end(), [] ( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs.time.Val(); } );
- }
- }
-
m_threadBackground = std::thread( [this, eventMask] {
std::vector<std::thread> jobs;