Save thread group hint.

This commit is contained in:
Bartosz Taudul 2024-08-03 20:23:26 +02:00
parent a1064a3d26
commit 0b74b14f88
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 11 additions and 3 deletions

View File

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

View File

@ -984,7 +984,15 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks, bool allow
{ {
auto td = m_slab.AllocInit<ThreadData>(); auto td = m_slab.AllocInit<ThreadData>();
uint64_t tid; uint64_t tid;
if( fileVer >= FileVersion( 0, 11, 1 ) )
{
f.Read5( tid, td->count, td->kernelSampleCnt, td->isFiber, td->groupHint );
}
else
{
f.Read4( tid, td->count, td->kernelSampleCnt, td->isFiber ); f.Read4( tid, td->count, td->kernelSampleCnt, td->isFiber );
td->groupHint = 0;
}
td->id = tid; td->id = tid;
m_data.zonesCnt += td->count; m_data.zonesCnt += td->count;
uint32_t tsz; uint32_t tsz;
@ -1054,7 +1062,6 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks, bool allow
f.Skip( ssz * ( 8 + 3 ) ); f.Skip( ssz * ( 8 + 3 ) );
} }
} }
td->groupHint = 0;
m_data.threads[i] = td; m_data.threads[i] = td;
m_threadMap.emplace( tid, td ); m_threadMap.emplace( tid, td );
} }
@ -7904,6 +7911,7 @@ void Worker::Write( FileWrite& f, bool fiDict )
f.Write( &thread->count, sizeof( thread->count ) ); f.Write( &thread->count, sizeof( thread->count ) );
f.Write( &thread->kernelSampleCnt, sizeof( thread->kernelSampleCnt ) ); f.Write( &thread->kernelSampleCnt, sizeof( thread->kernelSampleCnt ) );
f.Write( &thread->isFiber, sizeof( thread->isFiber ) ); f.Write( &thread->isFiber, sizeof( thread->isFiber ) );
f.Write( &thread->groupHint, sizeof( thread->groupHint ) );
WriteTimeline( f, thread->timeline, refTime ); WriteTimeline( f, thread->timeline, refTime );
sz = thread->messages.size(); sz = thread->messages.size();
f.Write( &sz, sizeof( sz ) ); f.Write( &sz, sizeof( sz ) );