mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Move Set/GetThreadName() to Tracy API.
This commit is contained in:
parent
2377911313
commit
a90004b983
@ -870,7 +870,7 @@ TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue();
|
|||||||
|
|
||||||
struct RPMallocInit { RPMallocInit() { rpmalloc_initialize(); } };
|
struct RPMallocInit { RPMallocInit() { rpmalloc_initialize(); } };
|
||||||
|
|
||||||
TRACY_API void InitRPMallocThread()
|
void InitRPMallocThread()
|
||||||
{
|
{
|
||||||
rpmalloc_initialize();
|
rpmalloc_initialize();
|
||||||
rpmalloc_thread_initialize();
|
rpmalloc_thread_initialize();
|
||||||
@ -941,14 +941,14 @@ TRACY_API std::atomic<uint32_t>& GetLockCounter() { return GetProfilerData().loc
|
|||||||
TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter() { return GetProfilerData().gpuCtxCounter; }
|
TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter() { return GetProfilerData().gpuCtxCounter; }
|
||||||
TRACY_API GpuCtxWrapper& GetGpuCtx() { return GetProfilerThreadData().gpuCtx; }
|
TRACY_API GpuCtxWrapper& GetGpuCtx() { return GetProfilerThreadData().gpuCtx; }
|
||||||
TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
||||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData() { return GetProfilerData().threadNameData; }
|
std::atomic<ThreadNameData*>& GetThreadNameData() { return GetProfilerData().threadNameData; }
|
||||||
|
|
||||||
# ifdef TRACY_ON_DEMAND
|
# ifdef TRACY_ON_DEMAND
|
||||||
TRACY_API LuaZoneState& GetLuaZoneState() { return GetProfilerThreadData().luaZoneState; }
|
TRACY_API LuaZoneState& GetLuaZoneState() { return GetProfilerThreadData().luaZoneState; }
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
TRACY_API void InitRPMallocThread()
|
void InitRPMallocThread()
|
||||||
{
|
{
|
||||||
rpmalloc_thread_initialize();
|
rpmalloc_thread_initialize();
|
||||||
}
|
}
|
||||||
@ -1003,7 +1003,7 @@ TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
|||||||
TRACY_API uint64_t GetThreadHandle() { return s_threadHandle.val; }
|
TRACY_API uint64_t GetThreadHandle() { return s_threadHandle.val; }
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData() { return s_threadNameData; }
|
std::atomic<ThreadNameData*>& GetThreadNameData() { return s_threadNameData; }
|
||||||
|
|
||||||
# ifdef TRACY_ON_DEMAND
|
# ifdef TRACY_ON_DEMAND
|
||||||
TRACY_API LuaZoneState& GetLuaZoneState() { return s_luaZoneState; }
|
TRACY_API LuaZoneState& GetLuaZoneState() { return s_luaZoneState; }
|
||||||
|
@ -58,7 +58,7 @@ TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter();
|
|||||||
TRACY_API GpuCtxWrapper& GetGpuCtx();
|
TRACY_API GpuCtxWrapper& GetGpuCtx();
|
||||||
TRACY_API uint64_t GetThreadHandle();
|
TRACY_API uint64_t GetThreadHandle();
|
||||||
|
|
||||||
TRACY_API void InitRPMallocThread();
|
void InitRPMallocThread();
|
||||||
|
|
||||||
struct SourceLocationData
|
struct SourceLocationData
|
||||||
{
|
{
|
||||||
|
@ -48,11 +48,11 @@ struct ThreadNameData
|
|||||||
const char* name;
|
const char* name;
|
||||||
ThreadNameData* next;
|
ThreadNameData* next;
|
||||||
};
|
};
|
||||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData();
|
std::atomic<ThreadNameData*>& GetThreadNameData();
|
||||||
TRACY_API void InitRPMallocThread();
|
void InitRPMallocThread();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SetThreadName( const char* name )
|
TRACY_API void SetThreadName( const char* name )
|
||||||
{
|
{
|
||||||
#if defined _WIN32 || defined __CYGWIN__
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
# if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2
|
# if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2
|
||||||
@ -118,7 +118,7 @@ void SetThreadName( const char* name )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GetThreadName( uint64_t id )
|
TRACY_API const char* GetThreadName( uint64_t id )
|
||||||
{
|
{
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
|
@ -72,8 +72,8 @@ static inline uint64_t GetThreadHandle()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SetThreadName( const char* name );
|
TRACY_API void SetThreadName( const char* name );
|
||||||
const char* GetThreadName( uint64_t id );
|
TRACY_API const char* GetThreadName( uint64_t id );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user