Skip to main content

Crate katra_trace

Crate katra_trace 

Source
Expand description

katra-trace — the Katra trace format.

A trace is a versioned, deterministic, append-only stream of records:

[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

Re-exports§

pub use header::FORMAT_VERSION;
pub use header::SCHEMA_HASH;
pub use header::SCHEMA_STRING;
pub use header::TRACE_MAGIC;
pub use header::TraceHeader;
pub use reader::TraceReader;
pub use reader::TraceReaderError;
pub use record::TraceRecord;
pub use record::TraceSummary;
pub use verify::VerifyIssue;
pub use verify::VerifyReport;
pub use writer::TraceWriter;
pub use writer::default_header;

Modules§

header
Trace header: magic, format version, schema hash, and capture metadata.
reader
Trace reader: iterates records from a trace file with validation.
record
Trace records.
verify
Trace verification: checks the invariants a well-formed trace must obey.
writer
Trace writer: appends length-prefixed bincode records to a file.