mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-22 16:50:49 +00:00
Split IsFrameExternalImpl into image + filename parts.
This commit is contained in:
@@ -8934,23 +8934,25 @@ void Worker::CacheSourceFiles()
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsFrameExternalImpl( const char* filename, const char* image )
|
||||
static bool IsImageExternalImpl( const char* image )
|
||||
{
|
||||
if( image && (
|
||||
strncmp( image, "/usr/", 5 ) == 0 ||
|
||||
strncmp( image, "/lib/", 5 ) == 0 ||
|
||||
strncmp( image, "/lib64/", 7 ) == 0 ||
|
||||
strcmp( image, "<kernel>" ) == 0
|
||||
) ) return true;
|
||||
assert( image );
|
||||
if( strncmp( image, "/usr/", 5 ) == 0 ) return true;
|
||||
if( strncmp( image, "/lib/", 5 ) == 0 ) return true;
|
||||
if( strncmp( image, "/lib64/", 7 ) == 0 ) return true;
|
||||
if( strcmp( image, "<kernel>" ) == 0 ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(
|
||||
strncmp( filename, "/usr/", 5 ) == 0 ||
|
||||
strncmp( filename, "/lib/", 5 ) == 0 ||
|
||||
strcmp( filename, "[unknown]" ) == 0 ||
|
||||
strcmp( filename, "<kernel>" ) == 0 ||
|
||||
strncmp( filename, "C:\\Program Files", 16 ) == 0 ||
|
||||
strncmp( filename, "d:\\a01\\_work\\", 13 ) == 0
|
||||
) return true;
|
||||
static bool IsSourceExternalImpl( const char* filename )
|
||||
{
|
||||
assert( filename );
|
||||
if( strncmp( filename, "/usr/", 5 ) == 0 ) return true;
|
||||
if( strncmp( filename, "/lib/", 5 ) == 0 ) return true;
|
||||
if( strcmp( filename, "[unknown]" ) == 0 ) return true;
|
||||
if( strcmp( filename, "<kernel>" ) == 0 ) return true;
|
||||
if( strncmp( filename, "C:\\Program Files", 16 ) == 0 ) return true;
|
||||
if( strncmp( filename, "d:\\a01\\_work\\", 13 ) == 0 ) return true;
|
||||
|
||||
while( *filename )
|
||||
{
|
||||
@@ -8961,6 +8963,12 @@ static bool IsFrameExternalImpl( const char* filename, const char* image )
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsFrameExternalImpl( const char* filename, const char* image )
|
||||
{
|
||||
if( image && IsImageExternalImpl( image ) ) return true;
|
||||
return IsSourceExternalImpl( filename );
|
||||
}
|
||||
|
||||
bool Worker::IsFrameExternal( StringIdx filename, StringIdx image ) const
|
||||
{
|
||||
return IsFrameExternalImpl( GetString( filename ), image.Active() ? GetString( image ) : nullptr );
|
||||
|
||||
Reference in New Issue
Block a user