[package]
name = "lightswitch"
version = "0.7.0"
edition = "2024"
description = "CPU profiler as a library for Linux suitable for on-demand and continuous profiling"
license = "MIT"
repository = "https://github.com/javierhonduco/lightswitch"
[workspace]
members = [
"lightswitch-*",
]
[workspace.dependencies]
memmap2 = "0.9.11"
anyhow = "1.0.102"
object = "0.40.0"
libbpf-rs = { version = "0.27.0" }
tracing = "0.1.44"
thiserror = "2.0.18"
perf-event-open-sys = "6.0.0"
procfs = "0.18.0"
nix = { version = "0.31.2", features = ["user"] }
tempfile = "3.27.0"
libbpf-cargo = { version = "0.27.0" }
glob = "0.3.3"
ring = "0.17.14"
libbpf-sys = "1.7.0"
lru = "0.18.2"
lightswitch-object = { path = "lightswitch-object", version = "0.4.0" }
plain = "0.2.3"
[features]
default = ["libbpf-rs-static", "kubernetes", "live-tui", "deadlock-detector"]
libbpf-rs-static = ["libbpf-rs/static"]
kubernetes = ["lightswitch-metadata/kubernetes", "rustls/aws_lc_rs"]
live-tui = ["dep:flamelens"]
deadlock-detector = ["parking_lot/deadlock_detection"]
[dependencies]
plain = { workspace = true }
clap = { version = "4.5.60", features = ["derive", "string"] }
blazesym = { version = "0.2.3", features = ["zlib"] }
tracing-subscriber = "0.3.22"
inferno = "0.12.6"
primal = "0.3.3"
prost = "0.14"
reqwest = { version = "0.13", features = ["blocking", "rustls", "json"], default-features = false }
ctrlc = "3.5.2"
serde = { version = "1.0.228", features = ["derive"] }
base64 = "0.23.1"
flate2 = "1.1.4"
uuid = { version = "1.18.1", features = ["v4"], default-features = false }
crossbeam-channel = "0.5.15"
itertools = "0.15.0"
lightswitch-metadata = { path = "lightswitch-metadata", version = "0.3.1" }
lightswitch-proto = { path = "lightswitch-proto", version = "0.3.1" }
lightswitch-capabilities = { path = "lightswitch-capabilities", version = "0.3.2" }
lightswitch-unwind-info = { path = "lightswitch-unwind-info", version = "0.2.0" }
lightswitch-object = { workspace = true }
memmap2 = { workspace = true }
anyhow = { workspace = true }
libbpf-sys = { workspace = true }
libbpf-rs = { workspace = true }
tracing = { workspace = true }
perf-event-open-sys = { workspace = true }
thiserror = { workspace = true }
procfs = { workspace = true }
nix = { workspace = true, features = ["user"] }
parking_lot = "0.12.5"
rustls = { version = "0.23", default-features = false, optional = true }
flamelens = { version = "0.4.0", default-features = false, optional = true }
lru = { workspace = true }
fxprof-processed-profile = "0.8.1"
serde_json = "1.0.150"
axum = "0.8.9"
tokio = { version = "1.52.3", features = ["rt-multi-thread"] }
urlencoding = "2.1.3"
tower-http = { version = "0.7.0", features = ["cors", "fs"] }
tempfile = { workspace = true }
[dev-dependencies]
assert_cmd = { version = "2.2.0" }
insta = { version = "1.46.3", features = ["yaml"] }
rstest = "0.26.1"
criterion = "0.8.2"
[build-dependencies]
libbpf-cargo = { workspace = true }
glob = { workspace = true }
bindgen = "0.72.1"
[profile.dev.package."*"]
opt-level = 3
[profile.release-lto]
inherits = "release"
lto = true
codegen-units = 1
[[bench]]
name = "benchmark"
harness = false
[[bin]]
name = "lightswitch"
path = "src/cli/main.rs"
[workspace.lints.rust]
trivial-numeric-casts = "warn"
unsafe-op-in-unsafe-fn = "warn"
unused = "warn"
[workspace.lints.clippy]
unwrap_used = "warn"
join-absolute-paths = "warn"
clone-on-ref-ptr = "warn"