mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
remove option to enable image cache, use it for TRACY_HAS_CALLSTACK == 3 to obtain image path and addreses instead of dladdr()
This commit is contained in:
parent
a618b6e6f8
commit
55f53b9979
@ -86,7 +86,6 @@ set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF)
|
|||||||
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
|
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
|
||||||
set_option(TRACE_CLIENT_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
|
set_option(TRACE_CLIENT_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
|
||||||
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
|
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
|
||||||
set_option(TRACY_ENABLE_IMAGE_CACHE "On glibc platforms, when doing offline symbol resolution, use an cache to determine the image path and offset instead of dladdr()" OFF)
|
|
||||||
|
|
||||||
if(NOT TRACY_STATIC)
|
if(NOT TRACY_STATIC)
|
||||||
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)
|
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)
|
||||||
|
@ -90,7 +90,7 @@ extern "C" const char* ___tracy_demangle( const char* mangled )
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( TRACY_ENABLE_IMAGE_CACHE) && (TRACY_HAS_CALLSTACK == 3)
|
#if TRACY_HAS_CALLSTACK == 3
|
||||||
# define TRACY_USE_IMAGE_CACHE
|
# define TRACY_USE_IMAGE_CACHE
|
||||||
# include <link.h>
|
# include <link.h>
|
||||||
#endif
|
#endif
|
||||||
@ -133,16 +133,10 @@ public:
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*RefreshCallback)();
|
|
||||||
void SetOnRefreshCallback( RefreshCallback callback )
|
|
||||||
{
|
|
||||||
m_onRefreshCallback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
tracy::FastVector<ImageEntry>* m_images;
|
tracy::FastVector<ImageEntry>* m_images;
|
||||||
const char* m_imageName = nullptr;
|
const char* m_imageName = nullptr;
|
||||||
RefreshCallback m_onRefreshCallback;
|
|
||||||
|
|
||||||
static int Callback( struct dl_phdr_info* info, size_t size, void* data )
|
static int Callback( struct dl_phdr_info* info, size_t size, void* data )
|
||||||
{
|
{
|
||||||
@ -185,8 +179,6 @@ private:
|
|||||||
|
|
||||||
std::sort( m_images->begin(), m_images->end(),
|
std::sort( m_images->begin(), m_images->end(),
|
||||||
[]( const ImageEntry& lhs, const ImageEntry& rhs ) { return lhs.m_startAddress > rhs.m_startAddress; } );
|
[]( const ImageEntry& lhs, const ImageEntry& rhs ) { return lhs.m_startAddress > rhs.m_startAddress; } );
|
||||||
|
|
||||||
if( m_onRefreshCallback ) m_onRefreshCallback();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImageEntry* GetImageEntryForAddress( void* address ) const
|
const ImageEntry* GetImageEntryForAddress( void* address ) const
|
||||||
@ -909,15 +901,7 @@ void InitCallstack()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef TRACY_USE_IMAGE_CACHE
|
|
||||||
s_imageCache->SetOnRefreshCallback([]()
|
|
||||||
{
|
|
||||||
// FIXME: there is no backtrace_destroy_state(), so we are forced to leak...
|
|
||||||
cb_bts = backtrace_create_state( nullptr, 0, nullptr, nullptr );
|
|
||||||
});
|
|
||||||
#else
|
|
||||||
cb_bts = backtrace_create_state( nullptr, 0, nullptr, nullptr );
|
cb_bts = backtrace_create_state( nullptr, 0, nullptr, nullptr );
|
||||||
#endif // #ifdef TRACY_USE_IMAGE_CACHE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TRACY_DEMANGLE
|
#ifndef TRACY_DEMANGLE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user