Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
180 lines (164 loc) Β· 7.2 KB
/
Copy pathCargo.toml
File metadata and controls
180 lines (164 loc) Β· 7.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Profile rustflags keep frame pointers in microscope's own builds without
# touching the RUSTFLAGS the test programs build with.
cargo-features = ["profile-rustflags"]
[package]
name = "microscope"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
description = "A Linux x86-64 native debugger"
repository = "https://github.com/microscope-dev/microscope"
readme = "README.md"
keywords = ["debugger", "dwarf", "linux", "ptrace"]
categories = ["command-line-utilities", "development-tools::debugging"]
[features]
# Fuzz harnesses synthesize object files from structured input.
fuzzing = ["object/write"]
# The deterministic simulator's sweep and replay binary. Its tests run with
# the library's own.
sim = []
# Allocates with the C library's allocator instead of mimalloc, for heap
# profilers such as Valgrind's that cannot see mimalloc.
system-alloc = []
# Loads a BPF sampler that times each walk of JavaScript frames and records
# the totals in the profile's setting `v8 walk times`, for measuring the walk
# alone (dev/performance.md). The shipping sampler has no clock.
bpf-walk-timing = []
# Developer tools: `microscope-tools` dumps every answer a program's debug
# information gives, loads programs for benchmarks, and summarizes timings.
tools = []
[[bin]]
name = "microscope-tools"
path = "src/bin/microscope-tools.rs"
required-features = ["tools"]
[[bin]]
name = "microscope-sim"
path = "src/bin/microscope-sim.rs"
required-features = ["sim"]
[lints.rust]
future_incompatible = { level = "deny", priority = -1 }
rust_2018_idioms = { level = "deny", priority = -1 }
unsafe_code = "deny"
unsafe_op_in_unsafe_fn = "deny"
unused = { level = "deny", priority = -1 }
# loom/ builds the protocols it checks under cfg(loom).
unexpected_cfgs = { level = "deny", check-cfg = ["cfg(loom)"] }
[lints.clippy]
all = { level = "deny", priority = -1 }
cargo = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
# Hash iteration order varies between runs, which would make the same input
# behave differently; clippy.toml bans the iterator methods `for` misses.
iter_over_hash_type = "deny"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
missing_safety_doc = "deny"
module_name_repetitions = "allow"
multiple_crate_versions = "allow"
undocumented_unsafe_blocks = "deny"
[dependencies]
anyhow = "1.0"
anstyle = "1.0"
anstyle-query = "1.1"
clap = { version = "4.6", features = ["derive", "wrap_help"] }
memchr = "2.8"
regex = "1.13"
rustyline = "18.0"
rustc_apfloat = "=0.2.3"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
serde_path_to_error = "0.1"
thiserror = "2.0"
wasmi = { version = "2.0", default-features = false, features = ["std", "validate"] }
tokio = { version = "1.52", features = ["fs", "io-std", "io-util", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] }
axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "ws"] }
toml = "1.1"
mimalloc = { version = "0.1", default-features = false }
foldhash = "0.2"
# pprof's profiles are gzipped; object already brings it in.
flate2 = "1.1"
# `alloc` for zeroed vectors the allocator can take from fresh, already
# zero pages instead of filling.
zerocopy = { version = "0.8", features = ["alloc", "derive"] }
rayon = "1.11"
twox-hash = { version = "2.1", default-features = false, features = ["std", "xxhash3_64", "xxhash3_128"] }
# The instrumentation ABI, which the collector reads: the SDK without its
# `enabled` feature is that and nothing else.
microscope-probes = { path = "sdk/rust-probes" }
sha2 = "0.11"
getrandom = "0.3"
[target.'cfg(target_os = "linux")'.dependencies]
aya = "0.14"
aya-obj = "0.3"
# C++20 manglings emitted by Chromium; see MICROSCOPE.md in the fork.
cpp_demangle = { git = "https://github.com/microscope-dev/cpp_demangle", rev = "3f6f357479cd8b7ffea785d8dace50e2bf974b5b" }
crc32fast = "1.5"
gimli = "0.34"
iced-x86 = { version = "1.21", default-features = false, features = ["decoder", "gas", "instr_info", "intel", "std"] }
lzma-rs = "0.3"
nix = { version = "0.31", features = ["feature", "fs", "personality", "poll", "ptrace", "process", "resource", "sched", "signal", "term", "time", "uio"] }
object = { version = "0.39", features = ["read"] }
# Decompresses zstd sections only as far as their claimed size, which object
# does not; object already brings it in.
ruzstd = "0.8"
perf-event = "0.4"
# Safe wrappers of the system calls nix does not make; clap brings it in.
rustix = { version = "1.1", features = ["event", "net", "param", "process", "thread"] }
# The Node inspector's CDP transport runs on its own threads, without tokio.
tungstenite = { version = "0.29", default-features = false, features = ["handshake"] }
ureq = { version = "3", default-features = false, features = ["rustls"] }
rustc-demangle = "0.1"
[dev-dependencies]
expectrl = "0.9"
futures-util = { version = "0.3.34", default-features = false, features = ["sink"] }
jsonschema = { version = "0.58", default-features = false }
# fork and timeout let a case that hangs or aborts the process still
# shrink; see dev/testing.md.
proptest = { version = "1.11", default-features = false, features = ["fork", "std", "timeout"] }
proptest-state-machine = "0.6"
# Decodes the pprof profiles `convert` writes.
prost = "0.14"
tokio-tungstenite = "0.29"
ts-rs = { version = "12.0.1", features = ["serde-json-impl"] }
[target.'cfg(target_os = "linux")'.dev-dependencies]
object = { version = "0.39", features = ["read", "write"] }
# Debug-info normalization is deliberately CPU-heavy. A small amount of
# optimization keeps the full behavioral matrix fast without the compile cost
# or disabled safety checks of the release profile: at no optimization the
# suite takes three times as long. Optimized builds otherwise link-time
# optimize across a crate's codegen units, which repeats for the whole crate
# after every edit and takes as long as compiling the edit.
[profile.test]
opt-level = 1
debug = 1
lto = "off"
# An integer overflow is a bug; a release build panics on one rather than
# wrapping to a plausible wrong value. See dev/assertions.md.
# Every build keeps the frame-pointer chain, so a profile of microscope walks
# its stacks whole, past any stack copy: rayon nests its joins deep enough to
# outrun one. Loading debug information costs about 1% more for it.
[profile.dev]
rustflags = ["-C", "force-frame-pointers=yes"]
[profile.release]
overflow-checks = true
rustflags = ["-C", "force-frame-pointers=yes"]
# Profilers read release builds with line tables, which name the functions
# and lines their costs belong to.
[profile.profiling]
inherits = "release"
debug = "line-tables-only"
# Simulation sweeps: optimized, with the debug assertions that keep the
# flight recorder and internal checks on.
[profile.sim]
inherits = "release"
debug-assertions = true
overflow-checks = true
# Generating debuginfo for this crate more than doubles the incremental rebuild
# after an edit. Dependencies keep theirs since they are rarely rebuilt. Pass
# `--config 'profile.test.package.microscope.debug=2'` when stepping through a test.
[profile.test.package.microscope]
debug = 0
# The crate has more modules than an incremental build's 256 default codegen
# units, so a clean build merged them and ran fewer at once.
codegen-units = 4096