Skip to content

Commit

Permalink
invert features from no-verify -> verify
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontt authored and nagisa committed Aug 21, 2024
1 parent 0a430f4 commit 57896f6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion FEATURES.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
* `demangle` - requires that the demangling function be defined by the user.
See the `register_demangler!` macro for more details.
Corresponds to the `TRACY_DEMANGLE` define.
* `no-verify` - disables verification that spans are closed within Tracy's C API. Enabling this significantly reduces the relative overhead and timing precision of short lived spans (<100ns) - but can cause undefined behavior if spans are not closed, when using the Rust API this would likely correspond to calling a `std::mem::forget(span)`. Corresponds to the `TRACY_NO_VERIFY` define.
* `verify` - enables verification that spans are closed within Tracy's C API. Disabling this
reduces instrumentation overhead (~50% for 0 callstack depth spans) and improves timing precision
by a proportional amount. This is most noticeable in short lived spans (<100ns) but can cause
undefined behavior if spans are not closed. When using the provided Rust APIs this can occur if a
Span's drop code is not called (e.g. `std::mem::forget(span)`). When disabled
corresponds to the `TRACY_NO_VERIFY` 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.
2 changes: 1 addition & 1 deletion tracing-tracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ manual-lifetime = ["client/manual-lifetime"]
delayed-init = ["client/delayed-init"]
flush-on-exit = ["client/flush-on-exit"]
demangle = ["client/demangle"]
no-verify = ["client/no-verify"]
verify = ["client/verify"]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "tracing_tracy_docs"]
Expand Down
2 changes: 1 addition & 1 deletion tracy-client-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ delayed-init = []
callstack-inlines = []
flush-on-exit = []
demangle = []
no-verify = []
verify = []

[package.metadata.docs.rs]
all-features = true
Expand Down
6 changes: 3 additions & 3 deletions tracy-client-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ fn set_feature_defines(mut c: cc::Build) -> cc::Build {
if std::env::var_os("CARGO_FEATURE_ENABLE").is_some() {
c.define("TRACY_ENABLE", None);
}
if std::env::var_os("CARGO_FEATURE_NO_VERIFY").is_some() {
c.define("TRACY_NO_VERIFY", None);
}
if std::env::var_os("CARGO_FEATURE_TIMER_FALLBACK").is_some() {
c.define("TRACY_TIMER_FALLBACK", None);
}
Expand Down Expand Up @@ -68,6 +65,9 @@ fn set_feature_defines(mut c: cc::Build) -> cc::Build {
if std::env::var_os("CARGO_FEATURE_CALLSTACK_INLINES").is_none() {
c.define("TRACY_NO_CALLSTACK_INLINES", None);
}
if std::env::var_os("CARGO_FEATURE_VERIFY").is_none() {
c.define("TRACY_NO_VERIFY", None);
}
c
}

Expand Down
2 changes: 1 addition & 1 deletion tracy-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ manual-lifetime = ["sys/manual-lifetime"]
delayed-init = ["sys/delayed-init"]
flush-on-exit = ["sys/flush-on-exit"]
demangle = ["sys/demangle", "dep:rustc-demangle"]
no-verify = ["sys/no-verify"]
verify = ["sys/verify"]

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

0 comments on commit 57896f6

Please sign in to comment.