Don't pass memname parameter to functions handling allocation changes.

This commit is contained in:
Bartosz Taudul 2023-04-16 18:12:14 +02:00
parent 38b7aab4ef
commit 7797557e8c
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 14 additions and 14 deletions

View File

@ -5926,7 +5926,7 @@ void Worker::ProcessGpuContextName( const QueueGpuContextName& ev )
ctx->name = StringIdx( idx ); ctx->name = StringIdx( idx );
} }
MemEvent* Worker::ProcessMemAllocImpl( uint64_t memname, MemData& memdata, const QueueMemAlloc& ev ) MemEvent* Worker::ProcessMemAllocImpl( MemData& memdata, const QueueMemAlloc& ev )
{ {
if( memdata.active.find( ev.ptr ) != memdata.active.end() ) if( memdata.active.find( ev.ptr ) != memdata.active.end() )
{ {
@ -5965,11 +5965,11 @@ MemEvent* Worker::ProcessMemAllocImpl( uint64_t memname, MemData& memdata, const
memdata.high = std::max( high, ptrend ); memdata.high = std::max( high, ptrend );
memdata.usage += size; memdata.usage += size;
MemAllocChanged( memname, memdata, time ); MemAllocChanged( memdata, time );
return &mem; return &mem;
} }
MemEvent* Worker::ProcessMemFreeImpl( uint64_t memname, MemData& memdata, const QueueMemFree& ev ) MemEvent* Worker::ProcessMemFreeImpl( MemData& memdata, const QueueMemFree& ev )
{ {
const auto refTime = RefTime( m_refTimeSerial, ev.time ); const auto refTime = RefTime( m_refTimeSerial, ev.time );
@ -5996,14 +5996,14 @@ MemEvent* Worker::ProcessMemFreeImpl( uint64_t memname, MemData& memdata, const
memdata.usage -= mem.Size(); memdata.usage -= mem.Size();
memdata.active.erase( it ); memdata.active.erase( it );
MemAllocChanged( memname, memdata, time ); MemAllocChanged( memdata, time );
return &mem; return &mem;
} }
MemEvent* Worker::ProcessMemAlloc( const QueueMemAlloc& ev ) MemEvent* Worker::ProcessMemAlloc( const QueueMemAlloc& ev )
{ {
assert( m_memNamePayload == 0 ); assert( m_memNamePayload == 0 );
return ProcessMemAllocImpl( 0, *m_data.memory, ev ); return ProcessMemAllocImpl( *m_data.memory, ev );
} }
MemEvent* Worker::ProcessMemAllocNamed( const QueueMemAlloc& ev ) MemEvent* Worker::ProcessMemAllocNamed( const QueueMemAlloc& ev )
@ -6018,13 +6018,13 @@ MemEvent* Worker::ProcessMemAllocNamed( const QueueMemAlloc& ev )
it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first; it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first;
it->second->name = memname; it->second->name = memname;
} }
return ProcessMemAllocImpl( memname, *it->second, ev ); return ProcessMemAllocImpl( *it->second, ev );
} }
MemEvent* Worker::ProcessMemFree( const QueueMemFree& ev ) MemEvent* Worker::ProcessMemFree( const QueueMemFree& ev )
{ {
assert( m_memNamePayload == 0 ); assert( m_memNamePayload == 0 );
return ProcessMemFreeImpl( 0, *m_data.memory, ev ); return ProcessMemFreeImpl( *m_data.memory, ev );
} }
MemEvent* Worker::ProcessMemFreeNamed( const QueueMemFree& ev ) MemEvent* Worker::ProcessMemFreeNamed( const QueueMemFree& ev )
@ -6039,7 +6039,7 @@ MemEvent* Worker::ProcessMemFreeNamed( const QueueMemFree& ev )
it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first; it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first;
it->second->name = memname; it->second->name = memname;
} }
return ProcessMemFreeImpl( memname, *it->second, ev ); return ProcessMemFreeImpl( *it->second, ev );
} }
void Worker::ProcessMemAllocCallstack( const QueueMemAlloc& ev ) void Worker::ProcessMemAllocCallstack( const QueueMemAlloc& ev )
@ -6062,7 +6062,7 @@ void Worker::ProcessMemAllocCallstackNamed( const QueueMemAlloc& ev )
it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first; it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first;
it->second->name = memname; it->second->name = memname;
} }
auto mem = ProcessMemAllocImpl( memname, *it->second, ev ); auto mem = ProcessMemAllocImpl( *it->second, ev );
assert( m_serialNextCallstack != 0 ); assert( m_serialNextCallstack != 0 );
if( mem ) mem->SetCsAlloc( m_serialNextCallstack ); if( mem ) mem->SetCsAlloc( m_serialNextCallstack );
m_serialNextCallstack = 0; m_serialNextCallstack = 0;
@ -6088,7 +6088,7 @@ void Worker::ProcessMemFreeCallstackNamed( const QueueMemFree& ev )
it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first; it = m_data.memNameMap.emplace( memname, m_slab.AllocInit<MemData>() ).first;
it->second->name = memname; it->second->name = memname;
} }
auto mem = ProcessMemFreeImpl( memname, *it->second, ev ); auto mem = ProcessMemFreeImpl( *it->second, ev );
assert( m_serialNextCallstack != 0 ); assert( m_serialNextCallstack != 0 );
if( mem ) mem->csFree.SetVal( m_serialNextCallstack ); if( mem ) mem->csFree.SetVal( m_serialNextCallstack );
m_serialNextCallstack = 0; m_serialNextCallstack = 0;
@ -6901,7 +6901,7 @@ void Worker::ProcessFiberLeave( const QueueFiberLeave& ev )
td->fiber = nullptr; td->fiber = nullptr;
} }
void Worker::MemAllocChanged( uint64_t memname, MemData& memdata, int64_t time ) void Worker::MemAllocChanged( MemData& memdata, int64_t time )
{ {
const auto val = (double)memdata.usage; const auto val = (double)memdata.usage;
if( !memdata.plot ) if( !memdata.plot )

View File

@ -764,8 +764,8 @@ private:
tracy_force_inline void ProcessGpuZoneBeginAllocSrcLocImpl( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial ); tracy_force_inline void ProcessGpuZoneBeginAllocSrcLocImpl( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial );
tracy_force_inline void ProcessGpuZoneBeginImplCommon( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial ); tracy_force_inline void ProcessGpuZoneBeginImplCommon( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial );
tracy_force_inline void ProcessPlotDataImpl( uint64_t name, int64_t evTime, double val ); tracy_force_inline void ProcessPlotDataImpl( uint64_t name, int64_t evTime, double val );
tracy_force_inline MemEvent* ProcessMemAllocImpl( uint64_t memname, MemData& memdata, const QueueMemAlloc& ev ); tracy_force_inline MemEvent* ProcessMemAllocImpl( MemData& memdata, const QueueMemAlloc& ev );
tracy_force_inline MemEvent* ProcessMemFreeImpl( uint64_t memname, MemData& memdata, const QueueMemFree& ev ); tracy_force_inline MemEvent* ProcessMemFreeImpl( MemData& memdata, const QueueMemFree& ev );
tracy_force_inline void ProcessCallstackSampleImpl( const SampleData& sd, ThreadData& td ); tracy_force_inline void ProcessCallstackSampleImpl( const SampleData& sd, ThreadData& td );
tracy_force_inline void ProcessCallstackSampleInsertSample( const SampleData& sd, ThreadData& td ); tracy_force_inline void ProcessCallstackSampleInsertSample( const SampleData& sd, ThreadData& td );
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
@ -795,7 +795,7 @@ private:
int16_t ShrinkSourceLocationReal( uint64_t srcloc ); int16_t ShrinkSourceLocationReal( uint64_t srcloc );
int16_t NewShrinkedSourceLocation( uint64_t srcloc ); int16_t NewShrinkedSourceLocation( uint64_t srcloc );
tracy_force_inline void MemAllocChanged( uint64_t memname, MemData& memdata, int64_t time ); tracy_force_inline void MemAllocChanged( MemData& memdata, int64_t time );
void CreateMemAllocPlot( MemData& memdata ); void CreateMemAllocPlot( MemData& memdata );
void ReconstructMemAllocPlot( MemData& memdata ); void ReconstructMemAllocPlot( MemData& memdata );