1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Expose IsFrameExternal as View's method.

This commit is contained in:
Bartosz Taudul 2024-12-16 14:44:28 +01:00
parent 1e796064bc
commit 70fc28506f
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 9 additions and 8 deletions

View File

@ -314,6 +314,7 @@ private:
void AddAnnotation( int64_t start, int64_t end ); 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 GetThreadColor( uint64_t thread, int depth );
uint32_t GetSrcLocColor( const SourceLocation& srcloc, int depth ); uint32_t GetSrcLocColor( const SourceLocation& srcloc, int depth );
uint32_t GetRawSrcLocColor( const SourceLocation& srcloc, int depth ); uint32_t GetRawSrcLocColor( const SourceLocation& srcloc, int depth );

View File

@ -10,14 +10,6 @@
namespace tracy 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, "<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;
}
void View::DrawCallstackWindow() void View::DrawCallstackWindow()
{ {
bool show = true; bool show = true;

View File

@ -8,6 +8,14 @@
namespace tracy 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, "<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 ) uint32_t View::GetThreadColor( uint64_t thread, int depth )
{ {
return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 ); return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 );