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

Detect context switch callstack samples.

Context switch callstack samples are not included in the sampling data
statistics (as these don't represent random sampling), but are rather put into
a separate dedicated data structure.

For this to work, a complete context switch data has to be available for the
callstack timestamp. There is no guarantee it will be present at the time it
is needed, so a second structure is added to allow postponing qualification of
callstacks.
This commit is contained in:
Bartosz Taudul
2021-11-13 02:40:32 +01:00
parent 5b799e0e45
commit 745b795d50
3 changed files with 91 additions and 50 deletions
+2
View File
@@ -666,9 +666,11 @@ struct ThreadData
Vector<int64_t> childTimeStack;
Vector<GhostZone> ghostZones;
uint64_t ghostIdx;
Vector<SampleData> postponedSamples;
#endif
Vector<SampleData> samples;
SampleData pendingSample;
Vector<SampleData> ctxSwitchSamples;
uint64_t kernelSampleCnt;
uint8_t isFiber;
ThreadData* fiber;