mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 06:03:51 +00:00
s/TRACY_RDTSCP_SUPPORTED/TRACY_HW_TIMER/
This commit is contained in:
parent
2a427ba87a
commit
48665cc09b
@ -145,7 +145,7 @@ static inline int LuaZoneBegin( lua_State* L )
|
||||
auto& tail = token->get_tail_index();
|
||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -196,7 +196,7 @@ static inline int LuaZoneBeginN( lua_State* L )
|
||||
auto& tail = token->get_tail_index();
|
||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneBeginAllocSrcLoc );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -216,7 +216,7 @@ static inline int LuaZoneEnd( lua_State* L )
|
||||
auto& tail = token->get_tail_index();
|
||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
|
@ -497,7 +497,7 @@ bool Profiler::HandleServerQuery()
|
||||
|
||||
void Profiler::CalibrateTimer()
|
||||
{
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
uint32_t cpu;
|
||||
std::atomic_signal_fence( std::memory_order_acq_rel );
|
||||
const auto t0 = std::chrono::high_resolution_clock::now();
|
||||
@ -545,7 +545,7 @@ void Profiler::CalibrateDelay()
|
||||
auto item = ptoken->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
|
||||
MemWrite( &item->zoneBegin.thread, GetThreadHandle() );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -561,7 +561,7 @@ void Profiler::CalibrateDelay()
|
||||
auto item = ptoken->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||
MemWrite( &item->zoneEnd.thread, uint64_t( 0 ) );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneEnd.time, GetTime( item->zoneEnd.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -587,7 +587,7 @@ void Profiler::CalibrateDelay()
|
||||
auto item = ptoken->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
|
||||
MemWrite( &item->zoneBegin.thread, GetThreadHandle() );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -603,7 +603,7 @@ void Profiler::CalibrateDelay()
|
||||
auto item = ptoken->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||
MemWrite( &item->zoneEnd.thread, uint64_t( 0 ) );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneEnd.time, GetTime( item->zoneEnd.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __CYGWIN__ || ( ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) && !defined __ANDROID__ )
|
||||
# define TRACY_RDTSCP_SUPPORTED
|
||||
# define TRACY_HW_TIMER
|
||||
#endif
|
||||
|
||||
namespace tracy
|
||||
@ -61,7 +61,7 @@ public:
|
||||
Profiler();
|
||||
~Profiler();
|
||||
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
static tracy_force_inline int64_t tracy_rdtscp( uint32_t& cpu )
|
||||
{
|
||||
#if defined _MSC_VER || defined __CYGWIN__
|
||||
@ -75,7 +75,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
static tracy_force_inline int64_t tracy_rdtscp()
|
||||
{
|
||||
#if defined _MSC_VER || defined __CYGWIN__
|
||||
@ -92,7 +92,7 @@ public:
|
||||
|
||||
static tracy_force_inline int64_t GetTime( uint32_t& cpu )
|
||||
{
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
return tracy_rdtscp( cpu );
|
||||
#else
|
||||
cpu = 0xFFFFFFFF;
|
||||
@ -102,7 +102,7 @@ public:
|
||||
|
||||
static tracy_force_inline int64_t GetTime()
|
||||
{
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
return tracy_rdtscp();
|
||||
#else
|
||||
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
auto& tail = token->get_tail_index();
|
||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneBegin );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime( item->zoneBegin.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
@ -43,7 +43,7 @@ public:
|
||||
auto& tail = token->get_tail_index();
|
||||
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
|
||||
MemWrite( &item->hdr.type, QueueType::ZoneEnd );
|
||||
#ifdef TRACY_RDTSCP_SUPPORTED
|
||||
#ifdef TRACY_HW_TIMER
|
||||
MemWrite( &item->zoneEnd.time, Profiler::GetTime( item->zoneEnd.cpu ) );
|
||||
#else
|
||||
uint32_t cpu;
|
||||
|
Loading…
x
Reference in New Issue
Block a user