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
//! Encoding for the u64 carried in `tracing::span::Id`.
//!
//! Layout:
//!
//! ```text
//! top `shard_bits` bits → shard index (0 .. lane_count)
//! bottom `64 - shard_bits` bits → slab_idx + SLAB_OFFSET
//! ```
//!
//! `DISABLED = 1` is reserved for spans the predicate or capacity checks
//! rejected. Slab indices encode as `slab_idx + 2` (`SLAB_OFFSET`) so
//! shard 0 / slab_idx 0 doesn't collide with `DISABLED`.
//!
//! `actual_id` is **not** in the encoded id; it lives in the per-shard
//! sidecar `actual_ids: Box<[AtomicU64]>` (see `cache::ShardLane`).
//! `new_span` writes it when it inserts into the slab; `enter` reads it
//! lock-free and pushes a `StackedSpan { tracing_id, actual_id }` onto
//! `SPAN_STACK` so that a contextual `new_span` later can read its
//! parent's `actual_id` directly from the stack without locking the
//! parent's slab.
pub const DISABLED: u64 = 1;
pub const SLAB_OFFSET: u64 = 2;
pub
pub
pub