Capture utility also displays failure messages.

This commit is contained in:
Bartosz Taudul 2019-01-14 23:52:38 +01:00
parent 5a3856dff0
commit 3cd97138fc

View File

@ -179,6 +179,22 @@ int main( int argc, char** argv )
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
} }
const auto& failure = worker.GetFailureType();
if( failure != tracy::Worker::Failure::None )
{
printf( "\n\033[31;1mInstrumentation failure: " );
switch( failure )
{
case tracy::Worker::Failure::ZoneStack:
printf( "Invalid order of zone begin and end events." );
break;
default:
printf( "<unknown reason>" );
break;
}
printf( "\033[0m" );
}
printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nSaving trace...", worker.GetFrameCount( *worker.GetFramesBase() ), TimeToString( worker.GetLastTime() - worker.GetTimeBegin() ), RealToString( worker.GetZoneCount(), true ) ); printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nSaving trace...", worker.GetFrameCount( *worker.GetFramesBase() ), TimeToString( worker.GetLastTime() - worker.GetTimeBegin() ), RealToString( worker.GetZoneCount(), true ) );
fflush( stdout ); fflush( stdout );
auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output ) ); auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output ) );