Allow access to PID.

This commit is contained in:
Bartosz Taudul
2019-10-27 16:50:35 +01:00
parent 17165102fc
commit 0610c73be3
2 changed files with 5 additions and 3 deletions
+2 -3
View File
@@ -1017,6 +1017,7 @@ Profiler::Profiler()
, m_broadcast( nullptr )
, m_noExit( false )
, m_zoneId( 1 )
, m_pid( GetPid() )
, m_stream( LZ4_createStream() )
, m_buffer( (char*)tracy_malloc( TargetFrameSize*3 ) )
, m_bufferOffset( 0 )
@@ -1172,8 +1173,6 @@ void Profiler::Worker()
const auto hostinfo = GetHostInfo();
const auto hisz = std::min<size_t>( strlen( hostinfo ), WelcomeMessageHostInfoSize - 1 );
const uint64_t pid = GetPid();
#ifdef TRACY_ON_DEMAND
uint8_t onDemand = 1;
#else
@@ -1193,7 +1192,7 @@ void Profiler::Worker()
MemWrite( &welcome.delay, m_delay );
MemWrite( &welcome.resolution, m_resolution );
MemWrite( &welcome.epoch, m_epoch );
MemWrite( &welcome.pid, pid );
MemWrite( &welcome.pid, m_pid );
MemWrite( &welcome.onDemand, onDemand );
MemWrite( &welcome.isApple, isApple );
memcpy( welcome.programName, procname, pnsz );
+3
View File
@@ -446,6 +446,8 @@ public:
void SendString( uint64_t ptr, const char* str, QueueType type );
uint64_t Pid() const { return m_pid; }
private:
enum class DequeueStatus { Success, ConnectionLost, QueueEmpty };
@@ -541,6 +543,7 @@ private:
UdpBroadcast* m_broadcast;
bool m_noExit;
std::atomic<uint32_t> m_zoneId;
uint64_t m_pid;
uint64_t m_threadCtx;
int64_t m_refTimeThread;