1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Merge pull request #757 from JBurnWork/noCallstackUpdates

Updates to address compilation with TRACY_NO_CALLSTACK
This commit is contained in:
Bartosz Taudul 2024-03-23 01:26:42 +01:00 committed by GitHub
commit 8a411a72b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 26 deletions

View File

@ -31,20 +31,22 @@
#include "client/TracyAlloc.cpp" #include "client/TracyAlloc.cpp"
#include "client/TracyOverride.cpp" #include "client/TracyOverride.cpp"
#if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6 #if defined(TRACY_HAS_CALLSTACK)
# include "libbacktrace/alloc.cpp" # if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
# include "libbacktrace/dwarf.cpp" # include "libbacktrace/alloc.cpp"
# include "libbacktrace/fileline.cpp" # include "libbacktrace/dwarf.cpp"
# include "libbacktrace/mmapio.cpp" # include "libbacktrace/fileline.cpp"
# include "libbacktrace/posix.cpp" # include "libbacktrace/mmapio.cpp"
# include "libbacktrace/sort.cpp" # include "libbacktrace/posix.cpp"
# include "libbacktrace/state.cpp" # include "libbacktrace/sort.cpp"
# if TRACY_HAS_CALLSTACK == 4 # include "libbacktrace/state.cpp"
# include "libbacktrace/macho.cpp" # if TRACY_HAS_CALLSTACK == 4
# else # include "libbacktrace/macho.cpp"
# include "libbacktrace/elf.cpp" # else
# include "libbacktrace/elf.cpp"
# endif
# include "common/TracyStackFrames.cpp"
# endif # endif
# include "common/TracyStackFrames.cpp"
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -5,6 +5,15 @@
#include "../common/TracyForceInline.hpp" #include "../common/TracyForceInline.hpp"
#include "TracyCallstack.h" #include "TracyCallstack.h"
#ifndef TRACY_HAS_CALLSTACK
namespace tracy
{
static tracy_force_inline void* Callstack( int /*depth*/ ) { return nullptr; }
}
#else
#if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 5 #if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 5
# include <unwind.h> # include <unwind.h>
#elif TRACY_HAS_CALLSTACK >= 3 #elif TRACY_HAS_CALLSTACK >= 3
@ -17,15 +26,6 @@
# endif # endif
#endif #endif
#ifndef TRACY_HAS_CALLSTACK
namespace tracy
{
static tracy_force_inline void* Callstack( int depth ) { return nullptr; }
}
#else
#ifdef TRACY_DEBUGINFOD #ifdef TRACY_DEBUGINFOD
# include <elfutils/debuginfod.h> # include <elfutils/debuginfod.h>
#endif #endif

View File

@ -605,8 +605,7 @@ public:
profiler.m_serialLock.unlock(); profiler.m_serialLock.unlock();
#else #else
static_cast<void>(depth); // unused static_cast<void>(depth); // unused
static_cast<void>(name); // unused MemAllocNamed( ptr, size, secure, name );
MemAlloc( ptr, size, secure );
#endif #endif
} }
@ -629,8 +628,7 @@ public:
profiler.m_serialLock.unlock(); profiler.m_serialLock.unlock();
#else #else
static_cast<void>(depth); // unused static_cast<void>(depth); // unused
static_cast<void>(name); // unused MemFreeNamed( ptr, secure, name );
MemFree( ptr, secure );
#endif #endif
} }