mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Report CPU architecture in welcome message.
This commit is contained in:
parent
5a3dedea97
commit
add5b29d03
@ -1210,6 +1210,18 @@ void Profiler::Worker()
|
||||
uint8_t isApple = 0;
|
||||
#endif
|
||||
|
||||
#if defined __i386 || defined _M_IX86
|
||||
uint8_t cpuArch = CpuArchX86;
|
||||
#elif defined __x86_64__ || defined _M_X64
|
||||
uint8_t cpuArch = CpuArchX64;
|
||||
#elif defined __aarch64__
|
||||
uint8_t cpuArch = CpuArchArm64;
|
||||
#elif defined __ARM_ARCH
|
||||
uint8_t cpuArch = CpuArchArm32;
|
||||
#else
|
||||
uint8_t cpuArch = CpuArchUnknown;
|
||||
#endif
|
||||
|
||||
WelcomeMessage welcome;
|
||||
MemWrite( &welcome.timerMul, m_timerMul );
|
||||
MemWrite( &welcome.initBegin, GetInitTime() );
|
||||
@ -1221,6 +1233,7 @@ void Profiler::Worker()
|
||||
MemWrite( &welcome.samplingPeriod, m_samplingPeriod );
|
||||
MemWrite( &welcome.onDemand, onDemand );
|
||||
MemWrite( &welcome.isApple, isApple );
|
||||
MemWrite( &welcome.cpuArch, cpuArch );
|
||||
memcpy( welcome.programName, procname, pnsz );
|
||||
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||
memcpy( welcome.hostInfo, hostinfo, hisz );
|
||||
|
@ -63,6 +63,16 @@ struct ServerQueryPacket
|
||||
enum { ServerQueryPacketSize = sizeof( ServerQueryPacket ) };
|
||||
|
||||
|
||||
enum CpuArchitecture : uint8_t
|
||||
{
|
||||
CpuArchUnknown,
|
||||
CpuArchX86,
|
||||
CpuArchX64,
|
||||
CpuArchArm32,
|
||||
CpuArchArm64
|
||||
};
|
||||
|
||||
|
||||
struct WelcomeMessage
|
||||
{
|
||||
double timerMul;
|
||||
@ -75,6 +85,7 @@ struct WelcomeMessage
|
||||
int64_t samplingPeriod;
|
||||
uint8_t onDemand;
|
||||
uint8_t isApple;
|
||||
uint8_t cpuArch;
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
char hostInfo[WelcomeMessageHostInfoSize];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user