diff --git a/CHANGELOG.md b/CHANGELOG.md index bc29823f..10b68860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Remove `backtrace-rs` feature, as the default choice when not specified (#130) + ## [0.9.1] - 2022-05-19 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index b5d601a3..43a40fe2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,21 +10,18 @@ documentation = "https://docs.rs/pprof/" readme = "README.md" [features] -default = ["cpp", "backtrace-rs"] +default = ["cpp"] +cpp = ["symbolic-demangle/cpp"] flamegraph = ["inferno"] +frame-pointer = [] # A private feature to indicate either prost-codec or protobuf-codec is enabled. _protobuf = [] prost-codec = ["prost", "prost-derive", "prost-build", "_protobuf"] protobuf-codec = ["protobuf", "protobuf-codegen-pure", "_protobuf"] -backtrace-rs = ["backtrace"] -frame-pointer = ["backtrace"] - -cpp = ["symbolic-demangle/cpp"] - [dependencies] -backtrace = { version = "0.3", optional = true } +backtrace = { version = "0.3" } once_cell = "1.9" libc = "^0.2.66" log = "0.4" diff --git a/README.md b/README.md index 3529b3c0..156ff5bb 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof::profiler: - `flamegraph` enables the flamegraph report format. - `prost-codec` enables the pprof protobuf report format through `prost`. - `protobuf-codec` enables the pprof protobuf report format through `protobuf` crate. -- `backtrace-rs` unwind the backtrace through `backtrace-rs` (which calls the `Unwind_Backtrace`). - `frame-pointer` gets the backtrace through frame pointer. **only available for nightly** ## Flamegraph diff --git a/src/backtrace/mod.rs b/src/backtrace/mod.rs index f838e858..44cd3214 100644 --- a/src/backtrace/mod.rs +++ b/src/backtrace/mod.rs @@ -44,9 +44,15 @@ pub trait Trace { Self: Sized; } -#[cfg(feature = "backtrace-rs")] +#[cfg(not(all( + any(target_arch = "x86_64", target_arch = "aarch64"), + feature = "frame-pointer" +)))] mod backtrace_rs; -#[cfg(feature = "backtrace-rs")] +#[cfg(not(all( + any(target_arch = "x86_64", target_arch = "aarch64"), + feature = "frame-pointer" +)))] pub use backtrace_rs::Trace as TraceImpl; #[cfg(all(