Count GPU zones.

This commit is contained in:
Bartosz Taudul 2019-10-13 14:13:04 +02:00
parent c3870f8837
commit 5e1894dd79
2 changed files with 10 additions and 9 deletions

View File

@ -3978,6 +3978,8 @@ void Worker::ProcessGpuNewContext( const QueueGpuNewContext& ev )
void Worker::ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev )
{
m_data.gpuCnt++;
auto ctx = m_gpuCtxMap[ev.context];
assert( ctx );
@ -4906,6 +4908,7 @@ void Worker::ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec, uint64_t size, i
{
assert( size != 0 );
vec.reserve_exact( size, m_slab );
m_data.gpuCnt += size;
auto zone = (GpuEvent*)m_slab.AllocBig( sizeof( GpuEvent ) * size );
auto zptr = zone;
auto vptr = vec.data();
@ -4939,6 +4942,7 @@ void Worker::ReadTimelinePre059( FileRead& f, Vector<GpuEvent*>& vec, uint64_t s
{
assert( size != 0 );
vec.reserve_exact( size, m_slab );
m_data.gpuCnt += size;
for( uint64_t i=0; i<size; i++ )
{

View File

@ -154,11 +154,7 @@ private:
struct DataBlock
{
DataBlock()
: zonesCnt( 0 )
, baseTime( 0 )
, lastTime( 0 )
, frameOffset( 0 )
, threadDataLast( std::numeric_limits<uint64_t>::max(), nullptr )
: threadDataLast( std::numeric_limits<uint64_t>::max(), nullptr )
, ctxSwitchLast( std::numeric_limits<uint64_t>::max(), nullptr )
{}
@ -170,10 +166,11 @@ private:
StringDiscovery<PlotData*> plots;
Vector<ThreadData*> threads;
MemData memory;
uint64_t zonesCnt;
int64_t baseTime;
int64_t lastTime;
uint64_t frameOffset;
uint64_t zonesCnt = 0;
uint64_t gpuCnt = 0;
int64_t baseTime = 0;
int64_t lastTime = 0;
uint64_t frameOffset = 0;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings;
Vector<const char*> stringData;