Move IsFrameExternal from View to TracyUtility.hpp.

This commit is contained in:
Bartosz Taudul
2026-01-08 20:28:16 +01:00
parent a5e5e8a435
commit e4ff8d34be
4 changed files with 10 additions and 9 deletions

View File

@@ -213,4 +213,12 @@ std::vector<std::string> SplitLines( const char* data, size_t sz )
return ret;
}
bool IsFrameExternal( const char* filename, const char* image )
{
if( strncmp( filename, "/usr/", 5 ) == 0 || strncmp( filename, "/lib/", 5 ) == 0 || strcmp( filename, "[unknown]" ) == 0 || strcmp( filename, "<kernel>" ) == 0 ) return true;
if( strncmp( filename, "C:\\Program Files\\", 17 ) == 0 || strncmp( filename, "d:\\a01\\_work\\", 13 ) == 0 ) return true;
if( !image ) return false;
return strncmp( image, "/usr/", 5 ) == 0 || strncmp( image, "/lib/", 5 ) == 0 || strncmp( image, "/lib64/", 7 ) == 0 || strcmp( image, "<kernel>" ) == 0;
}
}

View File

@@ -33,6 +33,8 @@ const char* FormatPlotValue( double val, PlotValueFormatting format );
std::vector<std::string> SplitLines( const char* data, size_t sz );
bool IsFrameExternal( const char* filename, const char* image );
}
#endif

View File

@@ -338,7 +338,6 @@ private:
void AddAnnotation( int64_t start, int64_t end );
bool IsFrameExternal( const char* filename, const char* image ) const;
uint32_t GetThreadColor( uint64_t thread, int depth );
uint32_t GetSrcLocColor( const SourceLocation& srcloc, int depth );
uint32_t GetRawSrcLocColor( const SourceLocation& srcloc, int depth );

View File

@@ -8,14 +8,6 @@
namespace tracy
{
bool View::IsFrameExternal( const char* filename, const char* image ) const
{
if( strncmp( filename, "/usr/", 5 ) == 0 || strncmp( filename, "/lib/", 5 ) == 0 || strcmp( filename, "[unknown]" ) == 0 || strcmp( filename, "<kernel>" ) == 0 ) return true;
if( strncmp( filename, "C:\\Program Files\\", 17 ) == 0 || strncmp( filename, "d:\\a01\\_work\\", 13 ) == 0 ) return true;
if( !image ) return false;
return strncmp( image, "/usr/", 5 ) == 0 || strncmp( image, "/lib/", 5 ) == 0 || strncmp( image, "/lib64/", 7 ) == 0 || strcmp( image, "<kernel>" ) == 0;
}
uint32_t View::GetThreadColor( uint64_t thread, int depth )
{
return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 );