mirror of
https://github.com/wolfpld/tracy
synced 2025-04-28 20:23:51 +00:00
set s_numCpus before reading it
This commit is contained in:
parent
fd604444eb
commit
5eb3e3a1f0
@ -817,6 +817,8 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
samplingPeriod = GetSamplingPeriod();
|
||||
uint32_t currentPid = (uint32_t)getpid();
|
||||
|
||||
s_numCpus = (int)std::thread::hardware_concurrency();
|
||||
|
||||
const auto maxNumBuffers = s_numCpus * (
|
||||
1 + // software sampling
|
||||
2 + // CPU cycles + instructions retired
|
||||
@ -824,7 +826,6 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
2 + // branch retired + miss
|
||||
2 // context switches + wakeups
|
||||
);
|
||||
s_numCpus = (int)std::thread::hardware_concurrency();
|
||||
s_ring = (RingBuffer*)tracy_malloc( sizeof( RingBuffer ) * maxNumBuffers );
|
||||
s_numBuffers = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user