Crash reports may be serialized.

This commit is contained in:
Bartosz Taudul 2021-10-10 15:58:24 +02:00
parent 9d89b84efd
commit a421083e58
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 15 additions and 4 deletions

View File

@ -611,10 +611,10 @@ LONG WINAPI CrashFilter( PEXCEPTION_POINTERS pExp )
{
GetProfiler().SendCallstack( 60, "KiUserExceptionDispatcher" );
TracyLfqPrepare( QueueType::CrashReport );
TracyQueuePrepare( QueueType::CrashReport );
item->crashReport.time = Profiler::GetTime();
item->crashReport.text = (uint64_t)s_crashText;
TracyLfqCommit;
TracyQueueCommit( crashReportThread );
}
HANDLE h = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
@ -850,10 +850,10 @@ static void CrashHandler( int signal, siginfo_t* info, void* /*ucontext*/ )
{
GetProfiler().SendCallstack( 60, "__kernel_rt_sigreturn" );
TracyLfqPrepare( QueueType::CrashReport );
TracyQueuePrepare( QueueType::CrashReport );
item->crashReport.time = Profiler::GetTime();
item->crashReport.text = (uint64_t)s_crashText;
TracyLfqCommit;
TracyQueueCommit( crashReportThread );
}
DIR* dp = opendir( "/proc/self/task" );
@ -2486,6 +2486,11 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
ThreadCtxCheckSerial( messageColorLiteralThread );
break;
}
case QueueType::CrashReport:
{
ThreadCtxCheckSerial( crashReportThread );
break;
}
default:
break;
}

View File

@ -502,6 +502,11 @@ struct QueueCrashReport
uint64_t text; // ptr
};
struct QueueCrashReportThread
{
uint32_t thread;
};
struct QueueSysTime
{
int64_t time;
@ -636,6 +641,7 @@ struct QueueItem
QueueSymbolInformation symbolInformation;
QueueCodeInformation codeInformation;
QueueCrashReport crashReport;
QueueCrashReportThread crashReportThread;
QueueSysTime sysTime;
QueueContextSwitch contextSwitch;
QueueThreadWakeup threadWakeup;