mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Send frame markers.
This commit is contained in:
parent
90cdda8542
commit
03ece0ac48
@ -1,8 +1,10 @@
|
|||||||
#ifndef __TRACY_HPP__
|
#ifndef __TRACY_HPP__
|
||||||
#define __TRACY_HPP__
|
#define __TRACY_HPP__
|
||||||
|
|
||||||
|
#include "TracyProfiler.hpp"
|
||||||
#include "TracyScoped.hpp"
|
#include "TracyScoped.hpp"
|
||||||
|
|
||||||
#define ZoneScoped tracy::ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ );
|
#define ZoneScoped tracy::ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ );
|
||||||
|
#define FrameMark tracy::Profiler::FrameMark();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,6 +75,14 @@ void Profiler::ZoneEnd( uint64_t id, QueueZoneEnd&& data )
|
|||||||
s_instance->m_queue.enqueue( GetToken(), std::move( item ) );
|
s_instance->m_queue.enqueue( GetToken(), std::move( item ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Profiler::FrameMark()
|
||||||
|
{
|
||||||
|
QueueItem item;
|
||||||
|
item.hdr.type = QueueType::FrameMark;
|
||||||
|
item.hdr.id = (uint64_t)GetTime();
|
||||||
|
s_instance->m_queue.enqueue( GetToken(), std::move( item ) );
|
||||||
|
}
|
||||||
|
|
||||||
Profiler* Profiler::Instance()
|
Profiler* Profiler::Instance()
|
||||||
{
|
{
|
||||||
return s_instance;
|
return s_instance;
|
||||||
|
@ -29,6 +29,7 @@ public:
|
|||||||
|
|
||||||
static uint64_t ZoneBegin( QueueZoneBegin&& data );
|
static uint64_t ZoneBegin( QueueZoneBegin&& data );
|
||||||
static void ZoneEnd( uint64_t id, QueueZoneEnd&& data );
|
static void ZoneEnd( uint64_t id, QueueZoneEnd&& data );
|
||||||
|
static void FrameMark();
|
||||||
|
|
||||||
static bool ShouldExit();
|
static bool ShouldExit();
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ enum class QueueType : uint8_t
|
|||||||
ZoneBegin,
|
ZoneBegin,
|
||||||
ZoneEnd,
|
ZoneEnd,
|
||||||
StringData,
|
StringData,
|
||||||
|
FrameMark,
|
||||||
NUM_TYPES
|
NUM_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ static const size_t QueueDataSize[] = {
|
|||||||
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
|
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
|
||||||
sizeof( QueueHeader ) + sizeof( QueueZoneEnd ),
|
sizeof( QueueHeader ) + sizeof( QueueZoneEnd ),
|
||||||
sizeof( QueueHeader ),
|
sizeof( QueueHeader ),
|
||||||
|
sizeof( QueueHeader ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert( sizeof( QueueDataSize ) / sizeof( size_t ) == (uint8_t)QueueType::NUM_TYPES, "QueueDataSize mismatch" );
|
static_assert( sizeof( QueueDataSize ) / sizeof( size_t ) == (uint8_t)QueueType::NUM_TYPES, "QueueDataSize mismatch" );
|
||||||
|
@ -168,6 +168,8 @@ void View::Process( const QueueItem& ev )
|
|||||||
case QueueType::ZoneEnd:
|
case QueueType::ZoneEnd:
|
||||||
ProcessZoneEnd( ev.hdr.id, ev.zoneEnd );
|
ProcessZoneEnd( ev.hdr.id, ev.zoneEnd );
|
||||||
break;
|
break;
|
||||||
|
case QueueType::FrameMark:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert( false );
|
assert( false );
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user