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

Send crash report.

This commit is contained in:
Bartosz Taudul
2018-08-20 02:07:31 +02:00
parent 49e36c013f
commit 3b526b074e
5 changed files with 59 additions and 2 deletions
+11
View File
@@ -181,6 +181,17 @@ struct CallstackFrameTree
enum { CallstackFrameTreeSize = sizeof( CallstackFrameTree ) };
struct CrashEvent
{
uint64_t thread = 0;
int64_t time = 0;
uint64_t message = 0;
uint32_t callstack = 0;
};
enum { CrashEventSize = sizeof( CrashEvent ) };
#pragma pack()
+19
View File
@@ -1929,6 +1929,9 @@ void Worker::Process( const QueueItem& ev )
case QueueType::Crash:
m_crashed = true;
break;
case QueueType::CrashReport:
ProcessCrashReport( ev.crashReport );
break;
default:
assert( false );
break;
@@ -2574,6 +2577,9 @@ void Worker::ProcessCallstack( const QueueCallstack& ev )
case NextCallstackType::Gpu:
next.gpu->callstack = it->second;
break;
case NextCallstackType::Crash:
m_data.m_crashEvent.callstack = it->second;
break;
default:
assert( false );
break;
@@ -2610,6 +2616,19 @@ void Worker::ProcessCallstackFrame( const QueueCallstackFrame& ev )
m_pendingCustomStrings.erase( m_pendingCustomStrings.find( ev.file ) );
}
void Worker::ProcessCrashReport( const QueueCrashReport& ev )
{
CheckString( ev.text );
auto& next = m_nextCallstack[ev.thread];
next.type = NextCallstackType::Crash;
m_data.m_crashEvent.thread = ev.thread;
m_data.m_crashEvent.time = TscTime( ev.time );
m_data.m_crashEvent.message = ev.text;
m_data.m_crashEvent.callstack = 0;
}
void Worker::MemAllocChanged( int64_t time )
{
const auto val = (double)m_data.memory.usage;
+5 -1
View File
@@ -140,6 +140,8 @@ private:
std::vector<Vector<ZoneEvent*>> m_zoneChildren;
std::vector<Vector<GpuEvent*>> m_gpuChildren;
CrashEvent m_crashEvent;
};
struct MbpsBlock
@@ -154,7 +156,8 @@ private:
enum class NextCallstackType
{
Zone,
Gpu
Gpu,
Crash
};
struct NextCallstack
@@ -297,6 +300,7 @@ private:
tracy_force_inline void ProcessCallstackMemory( const QueueCallstackMemory& ev );
tracy_force_inline void ProcessCallstack( const QueueCallstack& ev );
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );
tracy_force_inline void ProcessCrashReport( const QueueCrashReport& ev );
tracy_force_inline void ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev );
tracy_force_inline void ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev );