mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Add fiber enter API with group hint.
This commit is contained in:
parent
46852a7066
commit
37bfde5106
@ -4724,7 +4724,7 @@ TRACY_API int ___tracy_connected( void )
|
||||
}
|
||||
|
||||
#ifdef TRACY_FIBERS
|
||||
TRACY_API void ___tracy_fiber_enter( const char* fiber ){ tracy::Profiler::EnterFiber( fiber ); }
|
||||
TRACY_API void ___tracy_fiber_enter( const char* fiber ){ tracy::Profiler::EnterFiber( fiber, 0 ); }
|
||||
TRACY_API void ___tracy_fiber_leave( void ){ tracy::Profiler::LeaveFiber(); }
|
||||
#endif
|
||||
|
||||
|
@ -675,11 +675,12 @@ public:
|
||||
}
|
||||
|
||||
#ifdef TRACY_FIBERS
|
||||
static tracy_force_inline void EnterFiber( const char* fiber )
|
||||
static tracy_force_inline void EnterFiber( const char* fiber, int32_t groupHint )
|
||||
{
|
||||
TracyQueuePrepare( QueueType::FiberEnter );
|
||||
MemWrite( &item->fiberEnter.time, GetTime() );
|
||||
MemWrite( &item->fiberEnter.fiber, (uint64_t)fiber );
|
||||
MemWrite( &item->fiberEnter.groupHint, groupHint );
|
||||
TracyQueueCommit( fiberEnter );
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace tracy
|
||||
|
||||
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
|
||||
|
||||
enum : uint32_t { ProtocolVersion = 67 };
|
||||
enum : uint32_t { ProtocolVersion = 68 };
|
||||
enum : uint16_t { BroadcastVersion = 3 };
|
||||
|
||||
using lz4sz_t = uint32_t;
|
||||
|
@ -260,6 +260,7 @@ struct QueueFiberEnter
|
||||
int64_t time;
|
||||
uint64_t fiber; // ptr
|
||||
uint32_t thread;
|
||||
int32_t groupHint;
|
||||
};
|
||||
|
||||
struct QueueFiberLeave
|
||||
|
@ -119,6 +119,7 @@
|
||||
#define TracySetProgramName(x)
|
||||
|
||||
#define TracyFiberEnter(x)
|
||||
#define TracyFiberEnterHint(x,y)
|
||||
#define TracyFiberLeave
|
||||
|
||||
#else
|
||||
@ -287,7 +288,8 @@
|
||||
#define TracySetProgramName( name ) tracy::GetProfiler().SetProgramName( name );
|
||||
|
||||
#ifdef TRACY_FIBERS
|
||||
# define TracyFiberEnter( fiber ) tracy::Profiler::EnterFiber( fiber )
|
||||
# define TracyFiberEnter( fiber ) tracy::Profiler::EnterFiber( fiber, 0 )
|
||||
# define TracyFiberEnterHint( fiber, groupHint ) tracy::Profiler::EnterFiber( fiber, groupHint )
|
||||
# define TracyFiberLeave tracy::Profiler::LeaveFiber()
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user