1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

sort threads by tid

This commit is contained in:
Evan Klitzke 2020-11-19 16:30:02 -08:00
parent 9facbe848c
commit 10f51e1eee
No known key found for this signature in database
GPG Key ID: 7547F1FDF6629AFB
2 changed files with 9 additions and 0 deletions

View File

@ -3058,6 +3058,7 @@ void View::DrawZones()
{
m_threadOrder.push_back( threadData[i] );
}
SortThreads();
}
auto& crash = m_worker.GetCrashEvent();
@ -8991,6 +8992,7 @@ void View::DrawOptions()
m_threadOrder.insert( m_threadOrder.begin() + target, srcval );
m_threadOrder.erase( m_threadOrder.begin() + source );
}
SortThreads();
}
}
ImGui::TreePop();
@ -17624,4 +17626,10 @@ const char* View::SourceSubstitution( const char* srcFile ) const
return res.c_str();
}
void View::SortThreads() {
std::sort( m_threadOrder.begin(), m_threadOrder.end(),
[]( const ThreadData *a, const ThreadData *b ) {
return a->id < b->id;
} );
}
}

View File

@ -283,6 +283,7 @@ private:
void CalcZoneTimeDataImpl( const V& children, const ContextSwitch* ctx, unordered_flat_map<int16_t, ZoneTimeData>& data, int64_t& ztime, const ZoneEvent& zone );
void SetPlaybackFrame( uint32_t idx );
void SortThreads();
unordered_flat_map<const void*, VisData> m_visData;
unordered_flat_map<uint64_t, bool> m_visibleMsgThread;