mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Handle ending a zone twice.
This commit is contained in:
parent
a40ba8f4e9
commit
b74caae685
@ -4337,6 +4337,11 @@ void Worker::ProcessZoneEnd( const QueueZoneEnd& ev )
|
||||
auto td = m_threadCtxData;
|
||||
assert( td );
|
||||
|
||||
if( td->zoneIdStack.empty() )
|
||||
{
|
||||
ZoneDoubleEndFailure( m_threadCtx, td->timeline.empty() ? nullptr : td->timeline.back() );
|
||||
return;
|
||||
}
|
||||
auto zoneId = td->zoneIdStack.back_and_pop();
|
||||
if( zoneId != td->nextZoneId )
|
||||
{
|
||||
@ -4422,6 +4427,13 @@ void Worker::ZoneStackFailure( uint64_t thread, const ZoneEvent* ev )
|
||||
m_failureData.srcloc = ev->SrcLoc();
|
||||
}
|
||||
|
||||
void Worker::ZoneDoubleEndFailure( uint64_t thread, const ZoneEvent* ev )
|
||||
{
|
||||
m_failure = Failure::ZoneDoubleEnd;
|
||||
m_failureData.thread = thread;
|
||||
m_failureData.srcloc = ev ? ev->SrcLoc() : 0;
|
||||
}
|
||||
|
||||
void Worker::ZoneTextFailure( uint64_t thread )
|
||||
{
|
||||
m_failure = Failure::ZoneText;
|
||||
@ -7215,6 +7227,7 @@ void Worker::WriteTimelineImpl( FileWrite& f, const V& vec, int64_t& refTime, in
|
||||
static const char* s_failureReasons[] = {
|
||||
"<unknown reason>",
|
||||
"Invalid order of zone begin and end events.",
|
||||
"Zone is ended twice.",
|
||||
"Zone text transfer destination doesn't match active zone.",
|
||||
"Zone name transfer destination doesn't match active zone.",
|
||||
"Memory free event without a matching allocation.",
|
||||
|
@ -349,6 +349,7 @@ public:
|
||||
{
|
||||
None,
|
||||
ZoneStack,
|
||||
ZoneDoubleEnd,
|
||||
ZoneText,
|
||||
ZoneName,
|
||||
MemFree,
|
||||
@ -615,6 +616,7 @@ private:
|
||||
tracy_force_inline void ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev, bool serial );
|
||||
|
||||
void ZoneStackFailure( uint64_t thread, const ZoneEvent* ev );
|
||||
void ZoneDoubleEndFailure( uint64_t thread, const ZoneEvent* ev );
|
||||
void ZoneTextFailure( uint64_t thread );
|
||||
void ZoneNameFailure( uint64_t thread );
|
||||
void MemFreeFailure( uint64_t thread );
|
||||
|
Loading…
Reference in New Issue
Block a user