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
//! katra-trace — the Katra trace format.
//!
//! A trace is a **versioned, deterministic, append-only stream** of records:
//!
//! ```text
//! [magic: 8 bytes] [format_version: u32] [header_len: u32] [header: bincode]
//! [record_len: u32] [record: bincode(TraceRecord)] ... (repeat)
//! ```
//!
//! Records are `Event`, `EpochMarker`, `Counter`, or `SessionSummary`.
//!
//! # Determinism
//!
//! * `seq` is monotonic; events are written in `seq` order.
//! * Timestamps are ns since profiler start (plus a wall-clock anchor in the
//! header and in epoch markers).
//! * Replay can therefore re-emit a trace at exact relative timing.
//!
//! # Versioning discipline
//!
//! * Enum layouts are serialized by variant index: **append new variants at
//! the end** of any enum in `katra-core`.
//! * Any layout-affecting change bumps [`header::SCHEMA_HASH`] (computed from
//! [`header::SCHEMA_STRING`] at compile time).
//! * Backward-incompatible changes bump [`header::FORMAT_VERSION`].
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;