Allow zone name retrieval from source location.

This commit is contained in:
Bartosz Taudul 2019-02-10 16:45:19 +01:00
parent 48c721c4b9
commit 76186f3221
2 changed files with 13 additions and 0 deletions

View File

@ -1325,6 +1325,18 @@ const SourceLocation& Worker::GetSourceLocation( int32_t srcloc ) const
}
}
const char* Worker::GetZoneName( const SourceLocation& srcloc ) const
{
if( srcloc.name.active )
{
return GetString( srcloc.name );
}
else
{
return GetString( srcloc.function );
}
}
const char* Worker::GetZoneName( const ZoneEvent& ev ) const
{
auto& srcloc = GetSourceLocation( ev.srcloc );

View File

@ -252,6 +252,7 @@ public:
const char* GetThreadString( uint64_t id ) const;
const SourceLocation& GetSourceLocation( int32_t srcloc ) const;
const char* GetZoneName( const SourceLocation& srcloc ) const;
const char* GetZoneName( const ZoneEvent& ev ) const;
const char* GetZoneName( const ZoneEvent& ev, const SourceLocation& srcloc ) const;
const char* GetZoneName( const GpuEvent& ev ) const;