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
//! Lightweight, TTY-gated progress reporting for the `analyze` pipeline.
//!
//! Unlike `--verbose` (per-phase timing) and `--trace-rss` (RSS probes), this
//! prints a single rewriting status line to stderr so a long run on a multi-GB
//! dump is not silent. It carries no data structures and does not touch the
//! pipeline's memory discipline: each `phase()` call writes one short string.
//!
//! Enablement is decided once by `main` (see `--progress auto|always|never`)
//! and stored in a process-global flag; `auto` enables only when stderr is a
//! real terminal and neither `--verbose` nor `--trace-rss` is active (those
//! already emit their own per-phase lines, so we would double-report).
use Write;
use ;
static ENABLED: AtomicBool = new;
/// Enable or disable progress output for the rest of the process.
/// Overwrite the current status line with `label`. No-op unless enabled.
/// Uses a carriage return + clear-to-end so successive phases reuse one line.
/// Clear the status line at the end of a run. No-op unless enabled.