Files
tracy/meson.options
Clément Grégoire f93d17a96f Add TRACY_PLATFORM_HEADER hook for unsupported platforms.
Extension point so private/unsupported platforms can plug in their own implementations of the kernel/libc primitives Tracy depends on, without patching the `#if`/`#elif` chains.

Projects supply a platform header via `-DTRACY_PLATFORM_HEADER="\"my_platform.h\""` at build time. Tracy includes it in any TU that needs the hooks. The header toggles per-category `TRACY_HAS_CUSTOM_*` macros and declares matching `tracy::Platform*` functions.

Available hooks:

- `TRACY_HAS_CUSTOM_THREAD_ID` → `PlatformGetThreadId`
- `TRACY_HAS_CUSTOM_USER_INFO` → `PlatformGetHostname`, `PlatformGetUserLogin`, `PlatformGetUserFullName`
- `TRACY_HAS_CUSTOM_SAFE_COPY` → `PlatformSafeMemcpy`
- `TRACY_HAS_CUSTOM_ALLOCATOR` → `PlatformMalloc`, `PlatformFree`, `PlatformRealloc`, `PlatformAllocatorInit`, `PlatformAllocatorThreadInit`, `PlatformAllocatorFinalize`, `PlatformAllocatorThreadFinalize`

Each hook is wired as the first arm of its respective `#if`/`#elif` chain, so existing supported platforms are unaffected.

Template files in `examples/CustomPlatform/` and a new subsection in `manual/tracy.tex` document the mechanism.
2026-05-24 15:42:42 +02:00

32 lines
3.8 KiB
Plaintext

option('tracy_enable', type : 'boolean', value : false, description : 'Enable profiling', yield: true)
option('on_demand', type : 'boolean', value : false, description : 'On-demand profiling')
option('callstack', type : 'integer', value : 0, description : 'Enforce callstack collection for tracy zones x frames deep')
option('platform_header', type : 'string', value : '', description : 'Path to a header providing TRACY_HAS_CUSTOM_* hooks for an unsupported platform')
option('no_callstack', type : 'boolean', value : false, description : 'Disable all callstack related functionality')
option('no_callstack_inlines', type : 'boolean', value : false, description : 'Disables the inline functions in callstacks')
option('only_localhost', type : 'boolean', value : false, description : 'Only listen on the localhost interface')
option('no_broadcast', type : 'boolean', value : false, description : 'Disable client discovery by broadcast to local network')
option('only_ipv4', type : 'boolean', value : false, description : 'Tracy will only accept connections on IPv4 addresses (disable IPv6)')
option('no_code_transfer', type : 'boolean', value : false, description : 'Disable collection of source code')
option('no_context_switch', type : 'boolean', value : false, description : 'Disable capture of context switches')
option('no_exit', type : 'boolean', value : false, description : 'Client executable does not exit until all profile data is sent to server')
option('no_sampling', type : 'boolean', value : false, description : 'Disable call stack sampling')
option('no_verify', type : 'boolean', value : false, description : 'Disable zone validation for C API')
option('no_vsync_capture', type : 'boolean', value : false, description : 'Disable capture of hardware Vsync events')
option('no_frame_image', type : 'boolean', value : false, description : 'Disable the frame image support and its thread')
option('no_system_tracing', type : 'boolean', value : false, description : 'Disable systrace sampling')
option('patchable_nopsleds', type : 'boolean', value : false, description : 'Enable nopsleds for efficient patching by system-level tools (e.g. rr)')
option('timer_fallback', type : 'boolean', value : false, description : 'Use lower resolution timers')
option('disallow_hw_timer', type : 'boolean', value : false, description : 'Disallow hardware timer (may be useful on VMs). Requires timer_fallback.')
option('libunwind_backtrace', type : 'boolean', value : false, description : 'Use libunwind backtracing where supported')
option('symbol_offline_resolve', type : 'boolean', value : false, description : 'Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution')
option('libbacktrace_elf_dynload_support', type : 'boolean', value : false, description : 'Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation')
option('delayed_init', type : 'boolean', value : false, description : 'Enable delayed initialization of the library (init on first call)')
option('manual_lifetime', type : 'boolean', value : false, description : 'Enable the manual lifetime management of the profile')
option('fibers', type : 'boolean', value : false, description : 'Enable fibers support')
option('no_crash_handler', type : 'boolean', value : false, description : 'Disable crash handling')
option('verbose', type : 'boolean', value : false, description : 'Enable verbose logging')
option('no_internal_message', type : 'boolean', value : false, description : 'Prevent the profiler from logging messages')
option('debuginfod', type : 'boolean', value : false, description : 'Enable debuginfod support')
option('ignore_memory_faults', type : 'boolean', value : false, description : 'Ignore instrumentation errors from memory free events that do not have a matching allocation')