Skip to content

Commit

Permalink
tracy - add disable-crash-handler to disable the crash handler (micro…
Browse files Browse the repository at this point in the history
  • Loading branch information
fran6co authored Feb 27, 2023
1 parent 6382d0d commit 06b0521
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
22 changes: 22 additions & 0 deletions ports/tracy/004-fix-crash-handler.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp
index ea168e4f..9287d433 100644
--- a/public/client/TracyProfiler.cpp
+++ b/public/client/TracyProfiler.cpp
@@ -1454,7 +1454,7 @@ Profiler::~Profiler()
if( m_crashHandlerInstalled ) RemoveVectoredExceptionHandler( m_exceptionHandler );
#endif

-#ifdef __linux__
+#if defined __linux__ && !defined TRACY_NO_CRASH_HANDLER
if( m_crashHandlerInstalled )
{
sigaction( TRACY_CRASH_SIGNAL, &m_prevSignal.pwr, nullptr );
@@ -1520,7 +1520,7 @@ bool Profiler::ShouldExit()

void Profiler::Worker()
{
-#ifdef __linux__
+#if defined __linux__ && !defined TRACY_NO_CRASH_HANDLER
s_profilerTid = syscall( SYS_gettid );
#endif

6 changes: 5 additions & 1 deletion ports/tracy/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ vcpkg_from_github(
001-fix-vcxproj-vcpkg.patch
002-fix-capstone-5.patch
003-fix-imgui-path.patch
004-fix-crash-handler.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
on-demand TRACY_ON_DEMAND)
on-demand TRACY_ON_DEMAND
INVERTED_FEATURES
crash-handler TRACY_NO_CRASH_HANDLER
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
Expand Down
8 changes: 7 additions & 1 deletion ports/tracy/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tracy",
"version-semver": "0.9.0",
"port-version": 2,
"port-version": 3,
"description": "A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.",
"homepage": "https://github.com/wolfpld/tracy",
"license": "BSD-3-Clause",
Expand All @@ -20,6 +20,9 @@
"host": true
}
],
"default-features": [
"crash-handler"
],
"features": {
"cli-tools": {
"description": "Build Tracy command-line tools: `capture`, `csvexport`, `import-chrome` and `update`",
Expand All @@ -35,6 +38,9 @@
}
]
},
"crash-handler": {
"description": "Enable crash handler"
},
"gui-tools": {
"description": "Build Tracy GUI tool: `profiler` (aka `Tracy` executable)",
"supports": "!(windows & x86)",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7846,7 +7846,7 @@
},
"tracy": {
"baseline": "0.9.0",
"port-version": 2
"port-version": 3
},
"transwarp": {
"baseline": "2.2.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tracy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0866d3457267bff478bd158261b25869adf3e480",
"version-semver": "0.9.0",
"port-version": 3
},
{
"git-tree": "0a59d32d18bdd3f15658de8b36d8003d398f19ed",
"version-semver": "0.9.0",
Expand Down

0 comments on commit 06b0521

Please sign in to comment.