Add IdentifySamples flag to the protocol.

On Windows there is no way to distinguish callstack data coming from random
sampling and from context switches. Each callstack timestamp has to be matched
against the context switch data in order to decide its origin. This is
obviously non-trivial.

On some other platforms, the origin information may be available right away,
in which case the process of matching against the context switch data, which
possibly includes postponing callstacks for processing in the future, may be
completely omitted.
This commit is contained in:
Bartosz Taudul 2021-12-04 14:50:25 +01:00
parent 2008c88983
commit 20f8c8b8a4
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 3 additions and 1 deletions

View File

@ -1540,6 +1540,7 @@ void Profiler::Worker()
#endif
#ifdef _WIN32
flags |= WelcomeFlag::CombineSamples;
flags |= WelcomeFlag::IdentifySamples;
#endif
#if defined __i386 || defined _M_IX86

View File

@ -9,7 +9,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 53 };
enum : uint32_t { ProtocolVersion = 54 };
enum : uint16_t { BroadcastVersion = 2 };
using lz4sz_t = uint32_t;
@ -86,6 +86,7 @@ struct WelcomeFlag
IsApple = 1 << 1,
CodeTransfer = 1 << 2,
CombineSamples = 1 << 3,
IdentifySamples = 1 << 4,
};
};