From e4ff8d34be2f5a54e858594198ff7761f0d19dd2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 8 Jan 2026 20:28:16 +0100 Subject: [PATCH] Move IsFrameExternal from View to TracyUtility.hpp. --- profiler/src/profiler/TracyUtility.cpp | 8 ++++++++ profiler/src/profiler/TracyUtility.hpp | 2 ++ profiler/src/profiler/TracyView.hpp | 1 - profiler/src/profiler/TracyView_Utility.cpp | 8 -------- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/profiler/src/profiler/TracyUtility.cpp b/profiler/src/profiler/TracyUtility.cpp index bc034364..f02ae968 100644 --- a/profiler/src/profiler/TracyUtility.cpp +++ b/profiler/src/profiler/TracyUtility.cpp @@ -213,4 +213,12 @@ std::vector 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, "" ) == 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, "" ) == 0; +} + } diff --git a/profiler/src/profiler/TracyUtility.hpp b/profiler/src/profiler/TracyUtility.hpp index c9a2e75d..0b86a456 100644 --- a/profiler/src/profiler/TracyUtility.hpp +++ b/profiler/src/profiler/TracyUtility.hpp @@ -33,6 +33,8 @@ const char* FormatPlotValue( double val, PlotValueFormatting format ); std::vector SplitLines( const char* data, size_t sz ); +bool IsFrameExternal( const char* filename, const char* image ); + } #endif diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 1838e8e1..9dc438c1 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -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 ); diff --git a/profiler/src/profiler/TracyView_Utility.cpp b/profiler/src/profiler/TracyView_Utility.cpp index 720b0dce..dbdfeaeb 100644 --- a/profiler/src/profiler/TracyView_Utility.cpp +++ b/profiler/src/profiler/TracyView_Utility.cpp @@ -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, "" ) == 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, "" ) == 0; -} - uint32_t View::GetThreadColor( uint64_t thread, int depth ) { return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 );