Skip to content

Commit 2faeaff

Browse files
committed
- Update tracy to 0.12.4
1 parent f77a1bc commit 2faeaff

35 files changed

+3710
-699
lines changed

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ pub fn build(b: *std.Build) void {
8080
tracy.addCSourceFile(.{
8181
.file = b.path("libs/tracy/TracyClient.cpp"),
8282
.flags = &.{
83-
if (options.enable_ztracy) "-DTRACY_ENABLE" else "",
84-
if (options.enable_fibers) "-DTRACY_FIBERS" else "",
8583
"-fno-sanitize=undefined",
8684
},
8785
});
8886

87+
if (options.enable_ztracy) tracy.root_module.addCMacro("TRACY_ENABLE", "");
88+
if (options.enable_fibers) tracy.root_module.addCMacro("TRACY_FIBERS", "");
8989
if (options.on_demand) tracy.root_module.addCMacro("TRACY_ON_DEMAND", "");
9090

9191
tracy.linkLibC();

libs/tracy/TracyClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include "client/TracyOverride.cpp"
3333
#include "client/TracyKCore.cpp"
3434

35+
#ifdef TRACY_ROCPROF
36+
# include "client/TracyRocprof.cpp"
37+
#endif
38+
3539
#if defined(TRACY_HAS_CALLSTACK)
3640
# if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
3741
# include "libbacktrace/alloc.cpp"

libs/tracy/client/TracyCallstack.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ extern "C"
282282
t_SymFromInlineContext _SymFromInlineContext = 0;
283283
t_SymGetLineFromInlineContext _SymGetLineFromInlineContext = 0;
284284

285-
TRACY_API ___tracy_t_RtlWalkFrameChain ___tracy_RtlWalkFrameChain = 0;
285+
typedef unsigned long (__stdcall *___tracy_t_RtlWalkFrameChain)( void**, unsigned long, unsigned long );
286+
___tracy_t_RtlWalkFrameChain ___tracy_RtlWalkFrameChainPtr = nullptr;
287+
TRACY_API unsigned long ___tracy_RtlWalkFrameChain( void** callers, unsigned long count, unsigned long flags)
288+
{
289+
return ___tracy_RtlWalkFrameChainPtr(callers, count, flags);
290+
}
286291
}
287292

288293
struct ModuleCache
@@ -307,7 +312,7 @@ size_t s_krnlCacheCnt;
307312

308313
void InitCallstackCritical()
309314
{
310-
___tracy_RtlWalkFrameChain = (___tracy_t_RtlWalkFrameChain)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlWalkFrameChain" );
315+
___tracy_RtlWalkFrameChainPtr = (___tracy_t_RtlWalkFrameChain)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlWalkFrameChain" );
311316
}
312317

313318
void DbgHelpInit()

libs/tracy/client/TracyCallstack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# endif
99

1010
# if defined _WIN32
11-
# include "../common/TracyUwp.hpp"
12-
# ifndef TRACY_UWP
11+
# include "../common/TracyWinFamily.hpp"
12+
# if !defined TRACY_WIN32_NO_DESKTOP
1313
# define TRACY_HAS_CALLSTACK 1
1414
# endif
1515
# elif defined __ANDROID__

libs/tracy/client/TracyCallstack.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
namespace tracy
1111
{
12-
static tracy_force_inline void* Callstack( int /*depth*/ ) { return nullptr; }
12+
static constexpr bool has_callstack() { return false; }
13+
static tracy_force_inline void* Callstack( int32_t /*depth*/ ) { return nullptr; }
1314
}
1415

1516
#else
@@ -38,6 +39,8 @@ static tracy_force_inline void* Callstack( int /*depth*/ ) { return nullptr; }
3839
namespace tracy
3940
{
4041

42+
static constexpr bool has_callstack() { return true; }
43+
4144
struct CallstackSymbolData
4245
{
4346
const char* file;
@@ -79,11 +82,10 @@ debuginfod_client* GetDebuginfodClient();
7982

8083
extern "C"
8184
{
82-
typedef unsigned long (__stdcall *___tracy_t_RtlWalkFrameChain)( void**, unsigned long, unsigned long );
83-
TRACY_API extern ___tracy_t_RtlWalkFrameChain ___tracy_RtlWalkFrameChain;
85+
TRACY_API unsigned long ___tracy_RtlWalkFrameChain( void**, unsigned long, unsigned long );
8486
}
8587

86-
static tracy_force_inline void* Callstack( int depth )
88+
static tracy_force_inline void* Callstack( int32_t depth )
8789
{
8890
assert( depth >= 1 && depth < 63 );
8991
auto trace = (uintptr_t*)tracy_malloc( ( 1 + depth ) * sizeof( uintptr_t ) );
@@ -112,7 +114,7 @@ static _Unwind_Reason_Code tracy_unwind_callback( struct _Unwind_Context* ctx, v
112114
return _URC_NO_REASON;
113115
}
114116

115-
static tracy_force_inline void* Callstack( int depth )
117+
static tracy_force_inline void* Callstack( int32_t depth )
116118
{
117119
assert( depth >= 1 && depth < 63 );
118120

@@ -127,7 +129,7 @@ static tracy_force_inline void* Callstack( int depth )
127129

128130
#elif TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
129131

130-
static tracy_force_inline void* Callstack( int depth )
132+
static tracy_force_inline void* Callstack( int32_t depth )
131133
{
132134
assert( depth >= 1 );
133135

libs/tracy/client/TracyLock.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ class Lockable
219219
m_ctx.CustomName( name, size );
220220
}
221221

222-
private:
223222
T m_lockable;
223+
224+
private:
224225
LockableCtx m_ctx;
225226
};
226227

@@ -535,8 +536,9 @@ class SharedLockable
535536
m_ctx.CustomName( name, size );
536537
}
537538

538-
private:
539539
T m_lockable;
540+
541+
private:
540542
SharedLockableCtx m_ctx;
541543
};
542544

0 commit comments

Comments
 (0)