MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Worker

Method Worker

Source/ThirdParty/tracy/client/TracyProfiler.cpp:1677–2191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1675}
1676
1677void Profiler::Worker()
1678{
1679#if defined __linux__ && !defined TRACY_NO_CRASH_HANDLER
1680 s_profilerTid = syscall( SYS_gettid );
1681#endif
1682
1683 ThreadExitHandler threadExitHandler;
1684
1685 SetThreadName( "Tracy Profiler" );
1686
1687#ifdef TRACY_DATA_PORT
1688 const bool dataPortSearch = false;
1689 auto dataPort = m_userPort != 0 ? m_userPort : TRACY_DATA_PORT;
1690#else
1691 const bool dataPortSearch = m_userPort == 0;
1692 auto dataPort = m_userPort != 0 ? m_userPort : 8086;
1693#endif
1694#ifdef TRACY_BROADCAST_PORT
1695 const auto broadcastPort = TRACY_BROADCAST_PORT;
1696#else
1697 const auto broadcastPort = 8086;
1698#endif
1699
1700 while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
1701
1702#ifdef TRACY_USE_RPMALLOC
1703 rpmalloc_thread_initialize();
1704#endif
1705
1706 m_exectime = 0;
1707 const auto execname = GetProcessExecutablePath();
1708 if( execname )
1709 {
1710 struct stat st;
1711 if( stat( execname, &st ) == 0 )
1712 {
1713 m_exectime = (uint64_t)st.st_mtime;
1714 }
1715 }
1716
1717 const auto procname = GetProcessName();
1718 const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
1719
1720 const auto hostinfo = GetHostInfo();
1721 const auto hisz = std::min<size_t>( strlen( hostinfo ), WelcomeMessageHostInfoSize - 1 );
1722
1723 const uint64_t pid = GetPid();
1724
1725 uint8_t flags = 0;
1726
1727#ifdef TRACY_ON_DEMAND
1728 flags |= WelcomeFlag::OnDemand;
1729#endif
1730#ifdef __APPLE__
1731 flags |= WelcomeFlag::IsApple;
1732#endif
1733#ifndef TRACY_NO_CODE_TRANSFER
1734 flags |= WelcomeFlag::CodeTransfer;

Callers 1

LaunchWorkerFunction · 0.80

Calls 15

GetProcessExecutablePathFunction · 0.85
GetProcessNameFunction · 0.85
GetHostInfoFunction · 0.85
GetPidFunction · 0.85
CpuIdFunction · 0.85
memcpyFunction · 0.85
MemWriteFunction · 0.85
GetInitTimeFunction · 0.85
memsetFunction · 0.85
tracy_mallocFunction · 0.85
tracy_freeFunction · 0.85

Tested by

no test coverage detected