mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-09 14:49:46 +00:00
The denominator subtracts context switch sample counts from total sample counts, both for the whole trace and within the range filter. The subtraction could underflow: on traces with inconsistent sample ordering the binary searches over the unsorted sample vectors can return too few samples, and a sample which arrives with a duplicated timestamp is merged into the existing entry while its context switch classification is still recorded, so the context switch samples are not a strict subset of the samples. An underflow made every percentage in the table display as zero. Clamp the subtraction, per thread in range mode, so that one thread with bad data does not affect the counts of the others.