1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 04:43:53 +00:00

Check if ring buffer was properly mapped.

This commit is contained in:
Bartosz Taudul 2022-04-04 17:56:40 +02:00
parent 2b24ad27b2
commit 3d28d1259b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -861,8 +861,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
TracyDebug( " No access to kernel samples\n" ); TracyDebug( " No access to kernel samples\n" );
} }
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCallstack ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCallstack );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
// CPU cycles + instructions retired // CPU cycles + instructions retired
@ -892,8 +895,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCpuCycles ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCpuCycles );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
@ -904,8 +910,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventInstructionsRetired ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventInstructionsRetired );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
} }
@ -926,8 +935,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCacheReference ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCacheReference );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
@ -938,8 +950,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCacheMiss ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventCacheMiss );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
} }
@ -955,8 +970,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventBranchRetired ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventBranchRetired );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
@ -967,8 +985,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventBranchMiss ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventBranchMiss );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
} }
@ -1001,8 +1022,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 256*1024, fd, EventContextSwitch, i ); new( s_ring+s_numBuffers ) RingBuffer( 256*1024, fd, EventContextSwitch, i );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
@ -1018,8 +1042,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
if( fd != -1 ) if( fd != -1 )
{ {
new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventWakeup, i ); new( s_ring+s_numBuffers ) RingBuffer( 64*1024, fd, EventWakeup, i );
s_numBuffers++; if( s_ring[s_numBuffers].IsValid() )
TracyDebug( " Core %i ok\n", i ); {
s_numBuffers++;
TracyDebug( " Core %i ok\n", i );
}
} }
} }
} }