mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
Store failure reason strings in Worker.
This commit is contained in:
parent
3cd97138fc
commit
9944a73444
@ -182,17 +182,7 @@ int main( int argc, char** argv )
|
|||||||
const auto& failure = worker.GetFailureType();
|
const auto& failure = worker.GetFailureType();
|
||||||
if( failure != tracy::Worker::Failure::None )
|
if( failure != tracy::Worker::Failure::None )
|
||||||
{
|
{
|
||||||
printf( "\n\033[31;1mInstrumentation failure: " );
|
printf( "\n\033[31;1mInstrumentation failure: %s\033[0m", tracy::Worker::GetFailureString( 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 ) );
|
||||||
|
@ -469,15 +469,7 @@ bool View::Draw()
|
|||||||
ImGui::Text( "Profiling session terminated due to improper instrumentation.\nPlease correct your program and try again." );
|
ImGui::Text( "Profiling session terminated due to improper instrumentation.\nPlease correct your program and try again." );
|
||||||
ImGui::Text( "Reason:" );
|
ImGui::Text( "Reason:" );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
switch( failure )
|
ImGui::Text( "%s", Worker::GetFailureString( failure ) );
|
||||||
{
|
|
||||||
case Worker::Failure::ZoneStack:
|
|
||||||
ImGui::Text( "Invalid order of zone begin and end events." );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
assert( false );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if( srcloc.name.active )
|
if( srcloc.name.active )
|
||||||
{
|
{
|
||||||
|
@ -3645,4 +3645,14 @@ void Worker::WriteTimeline( FileWrite& f, const Vector<GpuEvent*>& vec, int64_t&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char* s_failureReasons[] = {
|
||||||
|
"<unknown reason>",
|
||||||
|
"Invalid order of zone begin and end events."
|
||||||
|
};
|
||||||
|
|
||||||
|
const char* Worker::GetFailureString( Worker::Failure failure )
|
||||||
|
{
|
||||||
|
return s_failureReasons[(int)failure];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,9 @@ public:
|
|||||||
enum class Failure
|
enum class Failure
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
ZoneStack
|
ZoneStack,
|
||||||
|
|
||||||
|
NUM_FAILURES
|
||||||
};
|
};
|
||||||
|
|
||||||
Worker( const char* addr );
|
Worker( const char* addr );
|
||||||
@ -284,6 +286,7 @@ public:
|
|||||||
void ClearFailure() { m_failure = Failure::None; }
|
void ClearFailure() { m_failure = Failure::None; }
|
||||||
Failure GetFailureType() const { return m_failure; }
|
Failure GetFailureType() const { return m_failure; }
|
||||||
const FailureData& GetFailureData() const { return m_failureData; }
|
const FailureData& GetFailureData() const { return m_failureData; }
|
||||||
|
static const char* GetFailureString( Failure failure );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Exec();
|
void Exec();
|
||||||
|
Loading…
Reference in New Issue
Block a user