1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Extract zone name getting functionality.

This commit is contained in:
Bartosz Taudul
2018-06-29 15:14:20 +02:00
parent 102234321d
commit 865e8d8506
3 changed files with 47 additions and 51 deletions
+30
View File
@@ -853,6 +853,36 @@ const SourceLocation& Worker::GetSourceLocation( int32_t srcloc ) const
}
}
const char* Worker::GetZoneName( const ZoneEvent& ev ) const
{
auto& srcloc = GetSourceLocation( ev.srcloc );
return GetZoneName( ev, srcloc );
}
const char* Worker::GetZoneName( const ZoneEvent& ev, const SourceLocation& srcloc ) const
{
if( srcloc.name.active )
{
return GetString( srcloc.name );
}
else
{
return GetString( srcloc.function );
}
}
const char* Worker::GetZoneName( const GpuEvent& ev ) const
{
auto& srcloc = GetSourceLocation( ev.srcloc );
return GetZoneName( ev, srcloc );
}
const char* Worker::GetZoneName( const GpuEvent& ev, const SourceLocation& srcloc ) const
{
assert( srcloc.name.active );
return GetString( srcloc.name );
}
std::vector<int32_t> Worker::GetMatchingSourceLocation( const char* query ) const
{
std::vector<int32_t> match;