Skip to content

Commit 994ce49

Browse files
authored
Merge pull request #212 from cortex-command-community/update-tracy
Updated Tracy
2 parents 18d7286 + 8253715 commit 994ce49

40 files changed

+5991
-954
lines changed

external/sources/tracy/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the
22
3-clause BSD license.
33

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

77
Redistribution and use in source and binary forms, with or without

external/sources/tracy/meson.build

Lines changed: 104 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,138 @@
1-
project('tracy', ['cpp'], version: '0.10.0')
1+
project('tracy', ['cpp'], version: '0.12.2', meson_version: '>=1.3.0', default_options : ['cpp_std=c++11'])
2+
3+
# internal compiler flags
4+
tracy_compile_args = []
5+
6+
# compiler flags shared between the capture library itself and the code using it
7+
tracy_common_args = []
8+
9+
# dependencies that will be propagated to the users of the capture library
10+
tracy_public_deps = []
211

312
if get_option('tracy_enable')
4-
add_project_arguments('-DTRACY_ENABLE', language : 'cpp')
13+
tracy_common_args += ['-DTRACY_ENABLE']
514
endif
615

7-
if get_option('tracy_on_demand')
8-
add_project_arguments('-DTRACY_ON_DEMAND', language : 'cpp')
16+
if get_option('on_demand')
17+
tracy_common_args += ['-DTRACY_ON_DEMAND']
918
endif
1019

11-
if get_option('tracy_callstack')
12-
add_project_arguments('-DTRACY_CALLSTACK', language : 'cpp')
20+
if get_option('callstack')
21+
tracy_common_args += ['-DTRACY_CALLSTACK']
1322
endif
1423

15-
if get_option('tracy_no_callstack')
16-
add_project_arguments('-DTRACY_NO_CALLSTACK', language : 'cpp')
24+
if get_option('no_callstack')
25+
tracy_common_args += ['-DTRACY_NO_CALLSTACK']
1726
endif
1827

19-
if get_option('tracy_no_callstack_inlines')
20-
add_project_arguments('-DTRACY_NO_CALLSTACK_INLINES', language : 'cpp')
28+
if get_option('no_callstack_inlines')
29+
tracy_common_args += ['-DTRACY_NO_CALLSTACK_INLINES']
2130
endif
2231

23-
if get_option('tracy_only_localhost')
24-
add_project_arguments('-DTRACY_ONLY_LOCALHOST', language : 'cpp')
32+
if get_option('only_localhost')
33+
tracy_common_args += ['-DTRACY_ONLY_LOCALHOST']
2534
endif
2635

27-
if get_option('tracy_no_broadcast')
28-
add_project_arguments('-DTRACY_NO_BROADCAST', language : 'cpp')
36+
if get_option('no_broadcast')
37+
tracy_common_args += ['-DTRACY_NO_BROADCAST']
2938
endif
3039

31-
if get_option('tracy_only_ipv4')
32-
add_project_arguments('-DTRACY_ONLY_IPV4', language : 'cpp')
40+
if get_option('only_ipv4')
41+
tracy_common_args += ['-DTRACY_ONLY_IPV4']
3342
endif
3443

35-
if get_option('tracy_no_code_transfer')
36-
add_project_arguments('-DTRACY_NO_CODE_TRANSFER', language : 'cpp')
44+
if get_option('no_code_transfer')
45+
tracy_common_args += ['-DTRACY_NO_CODE_TRANSFER']
3746
endif
3847

39-
if get_option('tracy_no_context_switch')
40-
add_project_arguments('-DTRACY_NO_CONTEXT_SWITCH', language : 'cpp')
48+
if get_option('no_context_switch')
49+
tracy_common_args += ['-DTRACY_NO_CONTEXT_SWITCH']
4150
endif
4251

43-
if get_option('tracy_no_exit')
44-
add_project_arguments('-DTRACY_NO_EXIT', language : 'cpp')
52+
if get_option('no_exit')
53+
tracy_common_args += ['-DTRACY_NO_EXIT']
4554
endif
4655

47-
if get_option('tracy_no_sampling')
48-
add_project_arguments('-DTRACY_NO_SAMPLING', language : 'cpp')
56+
if get_option('no_sampling')
57+
tracy_common_args += ['-DTRACY_NO_SAMPLING']
4958
endif
5059

51-
if get_option('tracy_no_verify')
52-
add_project_arguments('-DTRACY_NO_VERIFY', language : 'cpp')
60+
if get_option('no_verify')
61+
tracy_common_args += ['-DTRACY_NO_VERIFY']
5362
endif
5463

55-
if get_option('tracy_no_vsync_capture')
56-
add_project_arguments('-DTRACY_NO_VSYNC_CAPTURE', language : 'cpp')
64+
if get_option('no_vsync_capture')
65+
tracy_common_args += ['-DTRACY_NO_VSYNC_CAPTURE']
5766
endif
5867

59-
if get_option('tracy_no_frame_image')
60-
add_project_arguments('-DTRACY_NO_FRAME_IMAGE', language : 'cpp')
68+
if get_option('no_frame_image')
69+
tracy_common_args += ['-DTRACY_NO_FRAME_IMAGE']
6170
endif
6271

63-
if get_option('tracy_no_system_tracing')
64-
add_project_arguments('-DTRACY_NO_SYSTEM_TRACING', language : 'cpp')
72+
if get_option('no_system_tracing')
73+
tracy_common_args += ['-DTRACY_NO_SYSTEM_TRACING']
6574
endif
6675

67-
if get_option('tracy_patchable_nopsleds')
68-
add_project_arguments('-DTRACY_PATCHABLE_NOPSLEDS', language : 'cpp')
76+
if get_option('patchable_nopsleds')
77+
tracy_common_args += ['-DTRACY_PATCHABLE_NOPSLEDS']
6978
endif
7079

71-
if get_option('tracy_delayed_init')
72-
add_project_arguments('-DTRACY_DELAYED_INIT', language : 'cpp')
80+
if get_option('delayed_init')
81+
tracy_common_args += ['-DTRACY_DELAYED_INIT']
7382
endif
7483

75-
if get_option('tracy_manual_lifetime')
76-
add_project_arguments('-DTRACY_MANUAL_LIFETIME', language : 'cpp')
84+
if get_option('manual_lifetime')
85+
tracy_common_args += ['-DTRACY_MANUAL_LIFETIME']
7786
endif
7887

79-
if get_option('tracy_fibers')
80-
add_project_arguments('-DTRACY_FIBERS', language : 'cpp')
88+
if get_option('fibers')
89+
tracy_common_args += ['-DTRACY_FIBERS']
8190
endif
8291

83-
if get_option('tracy_timer_fallback')
84-
add_project_arguments('-DTRACY_TIMER_FALLBACK', language : 'cpp')
92+
if get_option('timer_fallback')
93+
tracy_common_args += ['-DTRACY_TIMER_FALLBACK']
8594
endif
8695

87-
tracy_shared_libs = get_option('tracy_shared_libs')
88-
if tracy_shared_libs
89-
add_project_arguments('-DTRACY_EXPORTS', language : 'cpp')
96+
if get_option('no_crash_handler')
97+
tracy_common_args += ['-DTRACY_NO_CRASH_HANDLER']
98+
endif
99+
100+
if get_option('libunwind_backtrace')
101+
tracy_common_args += ['-DTRACY_LIBUNWIND_BACKTRACE']
102+
tracy_public_deps += dependency('libunwind')
103+
endif
104+
105+
if get_option('symbol_offline_resolve')
106+
tracy_compile_args += ['-DTRACY_SYMBOL_OFFLINE_RESOLVE']
107+
endif
108+
109+
if get_option('libbacktrace_elf_dynload_support')
110+
tracy_compile_args += ['-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT']
111+
endif
112+
113+
if get_option('verbose')
114+
tracy_common_args += ['-DTRACY_VERBOSE']
115+
endif
116+
117+
if get_option('debuginfod')
118+
tracy_common_args += ['-DTRACY_DEBUGINFOD']
119+
tracy_public_deps += dependency('libdebuginfod')
90120
endif
91121

92-
if get_option('tracy_no_crash_handler')
93-
add_project_arguments('-DTRACY_NO_CRASH_HANDLER', language : 'cpp')
122+
tracy_shared_libs = get_option('default_library') == 'shared'
123+
124+
if tracy_shared_libs
125+
tracy_compile_args += ['-DTRACY_EXPORTS']
94126
endif
95127

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

98132
includes = [
99133
'public/tracy/TracyC.h',
100134
'public/tracy/Tracy.hpp',
135+
'public/tracy/TracyCUDA.hpp',
101136
'public/tracy/TracyD3D11.hpp',
102137
'public/tracy/TracyD3D12.hpp',
103138
'public/tracy/TracyLua.hpp',
@@ -116,11 +151,13 @@ client_includes = [
116151
'public/client/TracyDebug.hpp',
117152
'public/client/TracyDxt1.hpp',
118153
'public/client/TracyFastVector.hpp',
154+
'public/client/TracyKCore.hpp',
119155
'public/client/TracyLock.hpp',
120156
'public/client/TracyProfiler.hpp',
121157
'public/client/TracyRingBuffer.hpp',
122158
'public/client/TracyScoped.hpp',
123159
'public/client/TracyStringHelpers.hpp',
160+
'public/client/TracySysPower.hpp',
124161
'public/client/TracySysTime.hpp',
125162
'public/client/TracySysTrace.hpp',
126163
'public/client/TracyThread.hpp'
@@ -130,7 +167,6 @@ common_includes = [
130167
'public/common/tracy_lz4.hpp',
131168
'public/common/tracy_lz4hc.hpp',
132169
'public/common/TracyAlign.hpp',
133-
'public/common/TracyAlign.hpp',
134170
'public/common/TracyAlloc.hpp',
135171
'public/common/TracyApi.h',
136172
'public/common/TracyColor.hpp',
@@ -155,40 +191,40 @@ tracy_public_include_dirs = include_directories('public')
155191

156192
compiler = meson.get_compiler('cpp')
157193
override_options = []
158-
if compiler.get_id() != 'msvc'
159-
override_options += 'cpp_std=c++11'
194+
# MSVC c++ lib does not work properly with C++11 and compilation may fail
195+
if compiler.has_define('_MSC_VER') and get_option('cpp_std') == 'c++11'
196+
override_options += 'cpp_std=c++14'
160197
endif
161198

162-
if tracy_shared_libs
163-
tracy = shared_library('tracy', tracy_src, tracy_header_files,
164-
dependencies : [ threads_dep ],
165-
include_directories : tracy_public_include_dirs,
166-
override_options : override_options,
167-
install : true)
168-
else
169-
tracy = static_library('tracy', tracy_src, tracy_header_files,
170-
dependencies : [ threads_dep ],
199+
tracy_compile_args += tracy_common_args
200+
201+
tracy_deps = [dependency('threads')] + tracy_public_deps
202+
203+
tracy = library('tracy', tracy_src, tracy_header_files,
204+
dependencies : tracy_deps,
171205
include_directories : tracy_public_include_dirs,
206+
cpp_args : tracy_compile_args,
172207
override_options : override_options,
173208
install : true)
174-
endif
175209

176-
install_headers(includes)
177-
install_headers(common_includes, subdir : 'common')
178-
install_headers(client_includes, subdir : 'client')
210+
install_headers(includes, subdir : 'tracy/tracy')
211+
install_headers(common_includes, subdir : 'tracy/common')
212+
install_headers(client_includes, subdir : 'tracy/client')
179213

180-
tracy_dep_compile_args = []
214+
tracy_dep_compile_args = tracy_common_args
181215

182216
if tracy_shared_libs
183217
tracy_dep_compile_args += [ '-DTRACY_IMPORTS' ]
184218
endif
185219

220+
pkg = import('pkgconfig')
221+
pkg.generate(tracy,
222+
extra_cflags : tracy_dep_compile_args,
223+
requires : tracy_public_deps)
224+
186225
tracy_dep = declare_dependency(
187226
compile_args : tracy_dep_compile_args,
188227
link_with : tracy,
189228
include_directories : tracy_public_include_dirs)
190229

191-
tracy_dep_dynamic = declare_dependency(
192-
include_directories : tracy_public_include_dirs)
193-
194230
meson.override_dependency('tracy', tracy_dep)

external/sources/tracy/meson.options

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
option('tracy_enable', type : 'boolean', value : true, description : 'Enable profiling', yield: true)
2+
option('on_demand', type : 'boolean', value : false, description : 'On-demand profiling')
3+
option('callstack', type : 'boolean', value : false, description : 'Enfore callstack collection for tracy regions')
4+
option('no_callstack', type : 'boolean', value : false, description : 'Disable all callstack related functionality')
5+
option('no_callstack_inlines', type : 'boolean', value : false, description : 'Disables the inline functions in callstacks')
6+
option('only_localhost', type : 'boolean', value : false, description : 'Only listen on the localhost interface')
7+
option('no_broadcast', type : 'boolean', value : false, description : 'Disable client discovery by broadcast to local network')
8+
option('only_ipv4', type : 'boolean', value : false, description : 'Tracy will only accept connections on IPv4 addresses (disable IPv6)')
9+
option('no_code_transfer', type : 'boolean', value : false, description : 'Disable collection of source code')
10+
option('no_context_switch', type : 'boolean', value : false, description : 'Disable capture of context switches')
11+
option('no_exit', type : 'boolean', value : false, description : 'Client executable does not exit until all profile data is sent to server')
12+
option('no_sampling', type : 'boolean', value : false, description : 'Disable call stack sampling')
13+
option('no_verify', type : 'boolean', value : false, description : 'Disable zone validation for C API')
14+
option('no_vsync_capture', type : 'boolean', value : false, description : 'Disable capture of hardware Vsync events')
15+
option('no_frame_image', type : 'boolean', value : false, description : 'Disable the frame image support and its thread')
16+
option('no_system_tracing', type : 'boolean', value : false, description : 'Disable systrace sampling')
17+
option('patchable_nopsleds', type : 'boolean', value : false, description : 'Enable nopsleds for efficient patching by system-level tools (e.g. rr)')
18+
option('timer_fallback', type : 'boolean', value : false, description : 'Use lower resolution timers')
19+
option('libunwind_backtrace', type : 'boolean', value : false, description : 'Use libunwind backtracing where supported')
20+
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')
21+
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')
22+
option('delayed_init', type : 'boolean', value : false, description : 'Enable delayed initialization of the library (init on first call)')
23+
option('manual_lifetime', type : 'boolean', value : false, description : 'Enable the manual lifetime management of the profile')
24+
option('fibers', type : 'boolean', value : false, description : 'Enable fibers support')
25+
option('no_crash_handler', type : 'boolean', value : false, description : 'Disable crash handling')
26+
option('verbose', type : 'boolean', value : false, description : 'Enable verbose logging')
27+
option('debuginfod', type : 'boolean', value : false, description : 'Enable debuginfod support')

external/sources/tracy/meson_options.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)