From 70fc28506f9920d3829abd1b57b6f76bcbaecb88 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 16 Dec 2024 14:44:28 +0100 Subject: [PATCH] Expose IsFrameExternal as View's method. --- profiler/src/profiler/TracyView.hpp | 1 + profiler/src/profiler/TracyView_Callstack.cpp | 8 -------- profiler/src/profiler/TracyView_Utility.cpp | 8 ++++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 3ca96e6f..9975cec2 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -314,6 +314,7 @@ private: void AddAnnotation( int64_t start, int64_t end ); + bool IsFrameExternal( const char* filename, const char* image ); 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_Callstack.cpp b/profiler/src/profiler/TracyView_Callstack.cpp index 9d50988d..e38c5a20 100644 --- a/profiler/src/profiler/TracyView_Callstack.cpp +++ b/profiler/src/profiler/TracyView_Callstack.cpp @@ -10,14 +10,6 @@ namespace tracy { -static 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; -} - void View::DrawCallstackWindow() { bool show = true; diff --git a/profiler/src/profiler/TracyView_Utility.cpp b/profiler/src/profiler/TracyView_Utility.cpp index f33b721e..93428ff7 100644 --- a/profiler/src/profiler/TracyView_Utility.cpp +++ b/profiler/src/profiler/TracyView_Utility.cpp @@ -8,6 +8,14 @@ namespace tracy { +bool View::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; +} + uint32_t View::GetThreadColor( uint64_t thread, int depth ) { return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 );