mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-01 07:58:31 +00:00
Report system tracing setup failures.
SysTraceStart previously reported success even when no perf events could be opened, leaving a worker thread running over no buffers and an empty CPU section without explanation; it now fails in that case. Also log when /proc/kallsyms cannot be read, which otherwise silently results in ??? kernel stack frames.
This commit is contained in:
@@ -1167,7 +1167,11 @@ size_t s_kernelSymCnt;
|
||||
static void InitKernelSymbols()
|
||||
{
|
||||
FILE* f = fopen( "/proc/kallsyms", "rb" );
|
||||
if( !f ) return;
|
||||
if( !f )
|
||||
{
|
||||
TracyDebug( "Failed to read /proc/kallsyms, kernel symbols will be unavailable." );
|
||||
return;
|
||||
}
|
||||
tracy::FastVector<KernelSymbol> tmpSym( 512 * 1024 );
|
||||
size_t linelen = 16 * 1024; // linelen must be big enough to prevent reallocs in getline()
|
||||
auto linebuf = (char*)tracy_malloc( linelen );
|
||||
|
||||
@@ -1112,6 +1112,14 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
|
||||
tracy_free( iter );
|
||||
|
||||
if( s_numBuffers == 0 )
|
||||
{
|
||||
tracy_free( s_ring );
|
||||
s_ring = nullptr;
|
||||
TracyDebug( "Failed to setup any system tracing events, system tracing disabled." );
|
||||
return false;
|
||||
}
|
||||
|
||||
traceActive.store( true, std::memory_order_relaxed );
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user