mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Merge pull request #347 from bjacob/set-numcpus
set s_numCpus before reading it
This commit is contained in:
commit
6b340b3700
@ -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…
Reference in New Issue
Block a user