mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-05 12:59:15 +00:00
Context switch samples were appended in arrival order. Samples which were postponed due to missing context switch data are replayed after newer samples were already classified, so the vector could become unordered. Everything that reads it assumes time order: the wait stacks range filter, the sampling statistics percentage denominator, and the context switch sample filters in the trace load jobs. In the load jobs an unordered vector could silently disable the filtering for the rest of a thread, reintroducing the context switch samples into the symbol and child sample maps. Use a SortedVector and restore the ordering at the points where it can break: after the postponed sample replay and when saving a trace. The save file version is bumped, so that the sort order check on load is only performed for traces saved by previous versions.