1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Disable by default. Add config option ("TRACY_IMAGE_CACHE") to enable it.

This commit is contained in:
trodrigues 2023-12-12 10:49:58 -06:00
parent 71628f4b1c
commit db136d3f66
3 changed files with 6 additions and 1 deletions

View File

@ -87,6 +87,7 @@ 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_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF) set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)
set_option(TRACY_IMAGE_CACHE "Enable use of a cache for image paths and address ranges to avoid calling dladdr() per symbol resolve" OFF)
if(NOT TRACY_STATIC) if(NOT TRACY_STATIC)
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS) target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)

View File

@ -110,6 +110,10 @@ if get_option('tracy_libbacktrace_elf_dynload_support')
tracy_compile_args += ['-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT'] tracy_compile_args += ['-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT']
endif endif
if get_option('tracy_image_cache')
tracy_compile_args += ['-DTRACY_IMAGE_CACHE']
endif
tracy_shared_libs = get_option('default_library') == 'shared' tracy_shared_libs = get_option('default_library') == 'shared'
if not tracy_shared_libs and get_option('tracy_shared_libs') if not tracy_shared_libs and get_option('tracy_shared_libs')
warning('tracy_shared_libs is set to true, but default_library is set to static. Building static library.') warning('tracy_shared_libs is set to true, but default_library is set to static. Building static library.')

View File

@ -90,7 +90,7 @@ extern "C" const char* ___tracy_demangle( const char* mangled )
#endif #endif
#endif #endif
#if TRACY_HAS_CALLSTACK == 3 #if defined(TRACY_IMAGE_CACHE) && (TRACY_HAS_CALLSTACK == 3)
# define TRACY_USE_IMAGE_CACHE # define TRACY_USE_IMAGE_CACHE
# include <link.h> # include <link.h>
#endif #endif