mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Allow crash event reporting.
When crash happens there's no longer anything to profile -- don't wait for unfinished zones to finish before sending client terminate confirmation.
This commit is contained in:
parent
ca939ccd19
commit
366ea35593
@ -16,6 +16,7 @@ enum class QueueType : uint8_t
|
||||
Callstack,
|
||||
Terminate,
|
||||
KeepAlive,
|
||||
Crash,
|
||||
ZoneBegin,
|
||||
ZoneBeginCallstack,
|
||||
ZoneEnd,
|
||||
@ -287,6 +288,7 @@ static const size_t QueueDataSize[] = {
|
||||
// above items must be first
|
||||
sizeof( QueueHeader ), // terminate
|
||||
sizeof( QueueHeader ), // keep alive
|
||||
sizeof( QueueHeader ), // crash
|
||||
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
|
||||
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack
|
||||
sizeof( QueueHeader ) + sizeof( QueueZoneEnd ),
|
||||
|
@ -192,6 +192,7 @@ Worker::Worker( const char* addr )
|
||||
, m_hasData( false )
|
||||
, m_shutdown( false )
|
||||
, m_terminate( false )
|
||||
, m_crashed( false )
|
||||
, m_stream( LZ4_createStreamDecode() )
|
||||
, m_buffer( new char[TargetFrameSize*3 + 1] )
|
||||
, m_bufferOffset( 0 )
|
||||
@ -220,6 +221,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
, m_hasData( true )
|
||||
, m_shutdown( false )
|
||||
, m_terminate( false )
|
||||
, m_crashed( false )
|
||||
, m_stream( nullptr )
|
||||
, m_buffer( nullptr )
|
||||
{
|
||||
@ -1315,16 +1317,19 @@ void Worker::Exec()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool done = true;
|
||||
for( auto& v : m_data.threads )
|
||||
if( !m_crashed )
|
||||
{
|
||||
if( !v->stack.empty() )
|
||||
bool done = true;
|
||||
for( auto& v : m_data.threads )
|
||||
{
|
||||
done = false;
|
||||
break;
|
||||
if( !v->stack.empty() )
|
||||
{
|
||||
done = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !done ) continue;
|
||||
}
|
||||
if( !done ) continue;
|
||||
ServerQuery( ServerQueryTerminate, 0 );
|
||||
break;
|
||||
}
|
||||
@ -1921,6 +1926,9 @@ void Worker::Process( const QueueItem& ev )
|
||||
break;
|
||||
case QueueType::KeepAlive:
|
||||
break;
|
||||
case QueueType::Crash:
|
||||
m_crashed = true;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
|
@ -375,6 +375,7 @@ private:
|
||||
std::string m_captureName;
|
||||
std::string m_hostInfo;
|
||||
bool m_terminate;
|
||||
bool m_crashed;
|
||||
LZ4_streamDecode_t* m_stream;
|
||||
char* m_buffer;
|
||||
int m_bufferOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user