[package]
name = "pprof-pyroscope-fork"
version = "0.1500.4"  # based on upstream pprof-rs v0.15.0
authors = ["Yang Keao <keao.yang@yahoo.com>"]
edition = "2021"
license = "Apache-2.0"
description = "An internal perf tools for rust programs."
repository = "https://github.com/grafana/pprof-rs"
documentation = "https://docs.rs/pprof-pyroscope-fork/"
readme = "README.md"
rust-version = "1.88.0"  # MSRV

[lib]
name = "pprof"  # keep Rust crate name as `pprof` so existing `use pprof::` code still compiles

[features]
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", "sha2", "_protobuf"]
protobuf-codec = ["protobuf", "protobuf-codegen", "_protobuf"]
framehop-unwinder = ["framehop", "memmap2", "object"]
perfmaps = ["arc-swap"]
large-depth = []
huge-depth = []

[dependencies]
backtrace = { version = "0.3" }
once_cell = "1.9"
libc = "^0.2.66"
log = "0.4"
nix = { version = "0.26", default-features = false, features = ["signal", "fs"] }
spin = "0.10"
tempfile = "3.1"
thiserror = "2.0"
findshlibs = "0.10"
cfg-if = "1.0"
smallvec = "1.7"

inferno = { version = "0.11", default-features = false, features = ["nameattr"], optional = true }
prost = { version = "0.12", optional = true }
prost-derive = { version = "0.12", optional = true }
protobuf = { version = ">=3.7.2", optional = true }
criterion = {version = "0.5", optional = true}
aligned-vec = "0.6"

# framehop unwinder dependencies
framehop = { version = "0.16", optional = true }
memmap2 = { version = "0.5.5", optional = true }
object = { version = "0.29.0", optional = true }
arc-swap = { version = "1.7.1", optional = true }

[dependencies.symbolic-demangle]
version = "12.1"
default-features = false
features = ["rust"]

[dev-dependencies]
criterion = "0.5"
rand = "0.8.6"

[build-dependencies]
prost-build = { version = "0.12", optional = true }
sha2 = { version = "0.10", optional = true }
protobuf-codegen = { version = "3.7.2", optional = true }

[[example]]
name = "flamegraph"
required-features = ["flamegraph"]

[[example]]
name = "profile_proto_with_prost"
required-features = ["protobuf", "prost-codec"]

[[example]]
name = "profile_proto_with_protobuf_codec"
required-features = ["protobuf", "protobuf-codec"]

[[example]]
name = "multithread_flamegraph"
required-features = ["flamegraph"]

[[example]]
name = "criterion"
required-features = ["flamegraph", "criterion"]

[[bench]]
name = "collector"
path = "benches/collector.rs"
harness = false

[[bench]]
name = "addr_validate"
path = "benches/addr_validate.rs"
harness = false

[package.metadata.docs.rs]
all-features = true
