Skip to content

Commit

Permalink
expose TRACY_NO_CRASH_HANDLER feature
Browse files Browse the repository at this point in the history
While this is surely a _very_ niche feature, turning off the default
crash handler can be useful in situations where the tracee sets up and
uses signal handlers in normal operation.
  • Loading branch information
Mrmaxmeier authored and nagisa committed Dec 28, 2024
1 parent 3369d33 commit cb38013
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions FEATURES.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
corresponds to the `TRACY_NO_VERIFY` define.
* `debuginfod` - enables debuginfo for system libraries on systems supporting debuginfod.
Corresponds to the `TRACY_DEBUGINFOD` define.
* `crash-handler` – activate signal handler that intercepts application crashes. Corresponds to the
`TRACY_NO_CRASH_HANDLER` define.

Refer to this package's `Cargo.toml` for the list of the features enabled by default. Refer to
the `Tracy` manual for more information on the implications of each feature.
3 changes: 2 additions & 1 deletion tracing-tracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ criterion = "0.5"
[features]
# Refer to FEATURES.mkd for documentation on features.
default = [ "enable", "system-tracing", "context-switch-tracing", "sampling", "code-transfer",
"broadcast", "callstack-inlines" ]
"broadcast", "callstack-inlines", "crash-handler" ]
broadcast = ["client/broadcast"]
code-transfer = ["client/code-transfer"]
context-switch-tracing = ["client/context-switch-tracing"]
Expand All @@ -52,6 +52,7 @@ flush-on-exit = ["client/flush-on-exit"]
demangle = ["client/demangle"]
verify = ["client/verify"]
debuginfod = ["client/debuginfod"]
crash-handler = ["client/crash-handler"]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "tracing_tracy_docs"]
Expand Down
3 changes: 2 additions & 1 deletion tracy-client-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cc = { version = "1.0.83", default-features = false }
[features]
# Refer to FEATURES.mkd for documentation on features.
default = [ "enable", "system-tracing", "context-switch-tracing", "sampling", "code-transfer",
"broadcast", "callstack-inlines" ]
"broadcast", "callstack-inlines", "crash-handler" ]
enable = []
fibers = []
system-tracing = []
Expand All @@ -50,6 +50,7 @@ flush-on-exit = []
demangle = []
verify = []
debuginfod = []
crash-handler = []

[package.metadata.docs.rs]
all-features = true
Expand Down
3 changes: 3 additions & 0 deletions tracy-client-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ fn set_feature_defines(mut c: cc::Build) -> cc::Build {
if std::env::var_os("CARGO_FEATURE_VERIFY").is_none() {
c.define("TRACY_NO_VERIFY", None);
}
if std::env::var_os("CARGO_FEATURE_CRASH_HANDLER").is_none() {
c.define("TRACY_NO_CRASH_HANDLER", None);
}
c
}

Expand Down
3 changes: 2 additions & 1 deletion tracy-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ version = "0.7"
[features]
# Refer to FEATURES.mkd for documentation on features.
default = [ "enable", "system-tracing", "context-switch-tracing", "sampling", "code-transfer",
"broadcast", "callstack-inlines" ]
"broadcast", "callstack-inlines", "crash-handler" ]
broadcast = ["sys/broadcast"]
code-transfer = ["sys/code-transfer"]
context-switch-tracing = ["sys/context-switch-tracing"]
Expand All @@ -66,6 +66,7 @@ flush-on-exit = ["sys/flush-on-exit"]
demangle = ["sys/demangle", "dep:rustc-demangle"]
verify = ["sys/verify"]
debuginfod = ["sys/debuginfod"]
crash-handler = ["sys/crash-handler"]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "tracy_client_docs"]
Expand Down

0 comments on commit cb38013

Please sign in to comment.