Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/sources/tracy/LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the
3-clause BSD license.

Copyright (c) 2017-2023, Bartosz Taudul <[email protected]>
Copyright (c) 2017-2025, Bartosz Taudul <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
172 changes: 104 additions & 68 deletions external/sources/tracy/meson.build
Original file line number Diff line number Diff line change
@@ -1,103 +1,138 @@
project('tracy', ['cpp'], version: '0.10.0')
project('tracy', ['cpp'], version: '0.12.2', meson_version: '>=1.3.0', default_options : ['cpp_std=c++11'])

# internal compiler flags
tracy_compile_args = []

# compiler flags shared between the capture library itself and the code using it
tracy_common_args = []

# dependencies that will be propagated to the users of the capture library
tracy_public_deps = []

if get_option('tracy_enable')
add_project_arguments('-DTRACY_ENABLE', language : 'cpp')
tracy_common_args += ['-DTRACY_ENABLE']
endif

if get_option('tracy_on_demand')
add_project_arguments('-DTRACY_ON_DEMAND', language : 'cpp')
if get_option('on_demand')
tracy_common_args += ['-DTRACY_ON_DEMAND']
endif

if get_option('tracy_callstack')
add_project_arguments('-DTRACY_CALLSTACK', language : 'cpp')
if get_option('callstack')
tracy_common_args += ['-DTRACY_CALLSTACK']
endif

if get_option('tracy_no_callstack')
add_project_arguments('-DTRACY_NO_CALLSTACK', language : 'cpp')
if get_option('no_callstack')
tracy_common_args += ['-DTRACY_NO_CALLSTACK']
endif

if get_option('tracy_no_callstack_inlines')
add_project_arguments('-DTRACY_NO_CALLSTACK_INLINES', language : 'cpp')
if get_option('no_callstack_inlines')
tracy_common_args += ['-DTRACY_NO_CALLSTACK_INLINES']
endif

if get_option('tracy_only_localhost')
add_project_arguments('-DTRACY_ONLY_LOCALHOST', language : 'cpp')
if get_option('only_localhost')
tracy_common_args += ['-DTRACY_ONLY_LOCALHOST']
endif

if get_option('tracy_no_broadcast')
add_project_arguments('-DTRACY_NO_BROADCAST', language : 'cpp')
if get_option('no_broadcast')
tracy_common_args += ['-DTRACY_NO_BROADCAST']
endif

if get_option('tracy_only_ipv4')
add_project_arguments('-DTRACY_ONLY_IPV4', language : 'cpp')
if get_option('only_ipv4')
tracy_common_args += ['-DTRACY_ONLY_IPV4']
endif

if get_option('tracy_no_code_transfer')
add_project_arguments('-DTRACY_NO_CODE_TRANSFER', language : 'cpp')
if get_option('no_code_transfer')
tracy_common_args += ['-DTRACY_NO_CODE_TRANSFER']
endif

if get_option('tracy_no_context_switch')
add_project_arguments('-DTRACY_NO_CONTEXT_SWITCH', language : 'cpp')
if get_option('no_context_switch')
tracy_common_args += ['-DTRACY_NO_CONTEXT_SWITCH']
endif

if get_option('tracy_no_exit')
add_project_arguments('-DTRACY_NO_EXIT', language : 'cpp')
if get_option('no_exit')
tracy_common_args += ['-DTRACY_NO_EXIT']
endif

if get_option('tracy_no_sampling')
add_project_arguments('-DTRACY_NO_SAMPLING', language : 'cpp')
if get_option('no_sampling')
tracy_common_args += ['-DTRACY_NO_SAMPLING']
endif

if get_option('tracy_no_verify')
add_project_arguments('-DTRACY_NO_VERIFY', language : 'cpp')
if get_option('no_verify')
tracy_common_args += ['-DTRACY_NO_VERIFY']
endif

if get_option('tracy_no_vsync_capture')
add_project_arguments('-DTRACY_NO_VSYNC_CAPTURE', language : 'cpp')
if get_option('no_vsync_capture')
tracy_common_args += ['-DTRACY_NO_VSYNC_CAPTURE']
endif

if get_option('tracy_no_frame_image')
add_project_arguments('-DTRACY_NO_FRAME_IMAGE', language : 'cpp')
if get_option('no_frame_image')
tracy_common_args += ['-DTRACY_NO_FRAME_IMAGE']
endif

if get_option('tracy_no_system_tracing')
add_project_arguments('-DTRACY_NO_SYSTEM_TRACING', language : 'cpp')
if get_option('no_system_tracing')
tracy_common_args += ['-DTRACY_NO_SYSTEM_TRACING']
endif

if get_option('tracy_patchable_nopsleds')
add_project_arguments('-DTRACY_PATCHABLE_NOPSLEDS', language : 'cpp')
if get_option('patchable_nopsleds')
tracy_common_args += ['-DTRACY_PATCHABLE_NOPSLEDS']
endif

if get_option('tracy_delayed_init')
add_project_arguments('-DTRACY_DELAYED_INIT', language : 'cpp')
if get_option('delayed_init')
tracy_common_args += ['-DTRACY_DELAYED_INIT']
endif

if get_option('tracy_manual_lifetime')
add_project_arguments('-DTRACY_MANUAL_LIFETIME', language : 'cpp')
if get_option('manual_lifetime')
tracy_common_args += ['-DTRACY_MANUAL_LIFETIME']
endif

if get_option('tracy_fibers')
add_project_arguments('-DTRACY_FIBERS', language : 'cpp')
if get_option('fibers')
tracy_common_args += ['-DTRACY_FIBERS']
endif

if get_option('tracy_timer_fallback')
add_project_arguments('-DTRACY_TIMER_FALLBACK', language : 'cpp')
if get_option('timer_fallback')
tracy_common_args += ['-DTRACY_TIMER_FALLBACK']
endif

tracy_shared_libs = get_option('tracy_shared_libs')
if tracy_shared_libs
add_project_arguments('-DTRACY_EXPORTS', language : 'cpp')
if get_option('no_crash_handler')
tracy_common_args += ['-DTRACY_NO_CRASH_HANDLER']
endif

if get_option('libunwind_backtrace')
tracy_common_args += ['-DTRACY_LIBUNWIND_BACKTRACE']
tracy_public_deps += dependency('libunwind')
endif

if get_option('symbol_offline_resolve')
tracy_compile_args += ['-DTRACY_SYMBOL_OFFLINE_RESOLVE']
endif

if get_option('libbacktrace_elf_dynload_support')
tracy_compile_args += ['-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT']
endif

if get_option('verbose')
tracy_common_args += ['-DTRACY_VERBOSE']
endif

if get_option('debuginfod')
tracy_common_args += ['-DTRACY_DEBUGINFOD']
tracy_public_deps += dependency('libdebuginfod')
endif

if get_option('tracy_no_crash_handler')
add_project_arguments('-DTRACY_NO_CRASH_HANDLER', language : 'cpp')
tracy_shared_libs = get_option('default_library') == 'shared'

if tracy_shared_libs
tracy_compile_args += ['-DTRACY_EXPORTS']
endif

threads_dep = dependency('threads')
if host_machine.system() == 'windows'
tracy_compile_args += ['-DWINVER=0x0601', '-D_WIN32_WINNT=0x0601']
endif

includes = [
'public/tracy/TracyC.h',
'public/tracy/Tracy.hpp',
'public/tracy/TracyCUDA.hpp',
'public/tracy/TracyD3D11.hpp',
'public/tracy/TracyD3D12.hpp',
'public/tracy/TracyLua.hpp',
Expand All @@ -116,11 +151,13 @@ client_includes = [
'public/client/TracyDebug.hpp',
'public/client/TracyDxt1.hpp',
'public/client/TracyFastVector.hpp',
'public/client/TracyKCore.hpp',
'public/client/TracyLock.hpp',
'public/client/TracyProfiler.hpp',
'public/client/TracyRingBuffer.hpp',
'public/client/TracyScoped.hpp',
'public/client/TracyStringHelpers.hpp',
'public/client/TracySysPower.hpp',
'public/client/TracySysTime.hpp',
'public/client/TracySysTrace.hpp',
'public/client/TracyThread.hpp'
Expand All @@ -130,7 +167,6 @@ common_includes = [
'public/common/tracy_lz4.hpp',
'public/common/tracy_lz4hc.hpp',
'public/common/TracyAlign.hpp',
'public/common/TracyAlign.hpp',
'public/common/TracyAlloc.hpp',
'public/common/TracyApi.h',
'public/common/TracyColor.hpp',
Expand All @@ -155,40 +191,40 @@ tracy_public_include_dirs = include_directories('public')

compiler = meson.get_compiler('cpp')
override_options = []
if compiler.get_id() != 'msvc'
override_options += 'cpp_std=c++11'
# MSVC c++ lib does not work properly with C++11 and compilation may fail
if compiler.has_define('_MSC_VER') and get_option('cpp_std') == 'c++11'
override_options += 'cpp_std=c++14'
endif

if tracy_shared_libs
tracy = shared_library('tracy', tracy_src, tracy_header_files,
dependencies : [ threads_dep ],
include_directories : tracy_public_include_dirs,
override_options : override_options,
install : true)
else
tracy = static_library('tracy', tracy_src, tracy_header_files,
dependencies : [ threads_dep ],
tracy_compile_args += tracy_common_args

tracy_deps = [dependency('threads')] + tracy_public_deps

tracy = library('tracy', tracy_src, tracy_header_files,
dependencies : tracy_deps,
include_directories : tracy_public_include_dirs,
cpp_args : tracy_compile_args,
override_options : override_options,
install : true)
endif

install_headers(includes)
install_headers(common_includes, subdir : 'common')
install_headers(client_includes, subdir : 'client')
install_headers(includes, subdir : 'tracy/tracy')
install_headers(common_includes, subdir : 'tracy/common')
install_headers(client_includes, subdir : 'tracy/client')

tracy_dep_compile_args = []
tracy_dep_compile_args = tracy_common_args

if tracy_shared_libs
tracy_dep_compile_args += [ '-DTRACY_IMPORTS' ]
endif

pkg = import('pkgconfig')
pkg.generate(tracy,
extra_cflags : tracy_dep_compile_args,
requires : tracy_public_deps)

tracy_dep = declare_dependency(
compile_args : tracy_dep_compile_args,
link_with : tracy,
include_directories : tracy_public_include_dirs)

tracy_dep_dynamic = declare_dependency(
include_directories : tracy_public_include_dirs)

meson.override_dependency('tracy', tracy_dep)
27 changes: 27 additions & 0 deletions external/sources/tracy/meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
option('tracy_enable', type : 'boolean', value : true, description : 'Enable profiling', yield: true)
option('on_demand', type : 'boolean', value : false, description : 'On-demand profiling')
option('callstack', type : 'boolean', value : false, description : 'Enfore callstack collection for tracy regions')
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('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('debuginfod', type : 'boolean', value : false, description : 'Enable debuginfod support')
23 changes: 0 additions & 23 deletions external/sources/tracy/meson_options.txt

This file was deleted.

Loading
Loading