Implement build id retrieval by image name.

This commit is contained in:
Bartosz Taudul 2022-05-01 14:50:50 +02:00
parent 324cab3d34
commit ae373b4050
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 18 additions and 0 deletions

View File

@ -728,6 +728,20 @@ int GetDebugInfoDescriptor( const char* buildid_data, size_t buildid_size, const
it->fd = fd >= 0 ? fd : -1;
return it->fd;
}
const uint8_t* GetBuildIdForImage( const char* image, size_t& size )
{
assert( image );
for( auto& v : s_di_known )
{
if( strcmp( image, v.filename ) == 0 )
{
size = v.buildid_size;
return v.buildid;
}
}
return nullptr;
}
#endif
void EndCallstack()

View File

@ -54,6 +54,10 @@ void InitCallstack();
void EndCallstack();
const char* GetKernelModulePath( uint64_t addr );
#ifdef TRACY_DEBUGINFOD
const uint8_t* GetBuildIdForImage( const char* image, size_t& size );
#endif
#if TRACY_HAS_CALLSTACK == 1
extern "C"