Skip to content

Commit 36e192d

Browse files
authored
Added tracy profiler client (#439)
* Added tracy profiler client * Added support for GPU profiling * Added support for memory profiling * Removed OvAnalytics * Added tracy-profiler.exe, with menu item to open it * Replaced some spaces by tabs in OvGame/premake5.lua * Added support for lua script profiling
1 parent a4bb104 commit 36e192d

File tree

127 files changed

+30526
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+30526
-1394
lines changed

Dependencies/tracy/TracyClient.cpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//
2+
// Tracy profiler
3+
// ----------------
4+
//
5+
// For fast integration, compile and
6+
// link with this source file (and none
7+
// other) in your executable (or in the
8+
// main DLL / shared object on multi-DLL
9+
// projects).
10+
//
11+
12+
// Define TRACY_ENABLE to enable profiler.
13+
14+
#include "common/TracySystem.cpp"
15+
16+
#ifdef TRACY_ENABLE
17+
18+
#ifdef _MSC_VER
19+
# pragma warning(push, 0)
20+
#endif
21+
22+
#include "common/tracy_lz4.cpp"
23+
#include "client/TracyProfiler.cpp"
24+
#include "client/TracyCallstack.cpp"
25+
#include "client/TracySysPower.cpp"
26+
#include "client/TracySysTime.cpp"
27+
#include "client/TracySysTrace.cpp"
28+
#include "common/TracySocket.cpp"
29+
#include "client/tracy_rpmalloc.cpp"
30+
#include "client/TracyDxt1.cpp"
31+
#include "client/TracyAlloc.cpp"
32+
#include "client/TracyOverride.cpp"
33+
#include "client/TracyKCore.cpp"
34+
35+
#if defined(TRACY_HAS_CALLSTACK)
36+
# if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
37+
# include "libbacktrace/alloc.cpp"
38+
# include "libbacktrace/dwarf.cpp"
39+
# include "libbacktrace/fileline.cpp"
40+
# include "libbacktrace/mmapio.cpp"
41+
# include "libbacktrace/posix.cpp"
42+
# include "libbacktrace/sort.cpp"
43+
# include "libbacktrace/state.cpp"
44+
# if TRACY_HAS_CALLSTACK == 4
45+
# include "libbacktrace/macho.cpp"
46+
# else
47+
# include "libbacktrace/elf.cpp"
48+
# endif
49+
# include "common/TracyStackFrames.cpp"
50+
# endif
51+
#endif
52+
53+
#ifdef _MSC_VER
54+
# pragma comment(lib, "ws2_32.lib")
55+
# pragma comment(lib, "dbghelp.lib")
56+
# pragma comment(lib, "advapi32.lib")
57+
# pragma comment(lib, "user32.lib")
58+
# pragma warning(pop)
59+
#endif
60+
61+
#endif
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include "../common/TracyAlloc.hpp"
2+
3+
#ifdef TRACY_USE_RPMALLOC
4+
5+
#include <atomic>
6+
7+
#include "../common/TracyForceInline.hpp"
8+
#include "../common/TracyYield.hpp"
9+
10+
namespace tracy
11+
{
12+
13+
extern thread_local bool RpThreadInitDone;
14+
extern std::atomic<int> RpInitDone;
15+
extern std::atomic<int> RpInitLock;
16+
17+
tracy_no_inline static void InitRpmallocPlumbing()
18+
{
19+
const auto done = RpInitDone.load( std::memory_order_acquire );
20+
if( !done )
21+
{
22+
int expected = 0;
23+
while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); }
24+
const auto done = RpInitDone.load( std::memory_order_acquire );
25+
if( !done )
26+
{
27+
rpmalloc_initialize();
28+
RpInitDone.store( 1, std::memory_order_release );
29+
}
30+
RpInitLock.store( 0, std::memory_order_release );
31+
}
32+
rpmalloc_thread_initialize();
33+
RpThreadInitDone = true;
34+
}
35+
36+
TRACY_API void InitRpmalloc()
37+
{
38+
if( !RpThreadInitDone ) InitRpmallocPlumbing();
39+
}
40+
41+
}
42+
43+
#endif

0 commit comments

Comments
 (0)