1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add zone value failure context.

This commit is contained in:
Bartosz Taudul
2021-10-10 14:12:13 +02:00
parent 9300934fa5
commit 930ef77ea9
3 changed files with 19 additions and 3 deletions
+13 -2
View File
@@ -4844,10 +4844,21 @@ void Worker::ZoneTextFailure( uint64_t thread )
m_failureData.thread = thread;
}
void Worker::ZoneValueFailure( uint64_t thread )
void Worker::ZoneValueFailure( uint64_t thread, uint64_t value )
{
char buf[128];
if( (int64_t)value < 0 )
{
sprintf( buf, "Zone value was: %" PRIu64 " (unsigned), %" PRIi64 " (signed)", value, (int64_t)value );
}
else
{
sprintf( buf, "Zone value was: %" PRIu64, value );
}
m_failure = Failure::ZoneValue;
m_failureData.thread = thread;
m_failureData.message = buf;
}
void Worker::ZoneColorFailure( uint64_t thread )
@@ -5120,7 +5131,7 @@ void Worker::ProcessZoneValue( const QueueZoneValue& ev )
auto td = RetrieveThread( m_threadCtx );
if( !td || td->stack.empty() || td->nextZoneId != td->zoneIdStack.back() )
{
ZoneValueFailure( m_threadCtx );
ZoneValueFailure( m_threadCtx, ev.value );
return;
}