Crates.io | runtime_tracing |
lib.rs | runtime_tracing |
version | 0.15.0 |
created_at | 2025-03-21 13:34:01.504162+00 |
updated_at | 2025-09-15 09:50:20.35699+00 |
description | A library for the schema and tracing helpers for the CodeTracer db trace format |
homepage | |
repository | https://github.com/metacraft-labs/runtime_tracing |
max_upload_size | |
id | 1600503 |
size | 114,342 |
A format and helper library for CodeTracer traces
A CodeTracer trace for its db backend consists of record data, metadata for the recorded program and copy of the relevant source/repository files. It's self contained, so one can debug a record of a version of a program from a different commit or branch. The record data consists of a stream of objects, each of which describes a certain program event: call, step, return etc.
A trace contains several files:
trace.json
– the event data in JSON formattrace.bin
– the same event stream encoded in a binary format (see
docs/trace_binary_spec.md)trace_metadata.json
– metadata for the recorded programtrace_paths.json
– a list of the recorded filesfiles/
– a folder including all the source/repository files copied into the trace.The event stream can be stored either as JSON (trace.json
) or in the
binary format (trace.bin
). Both representations correspond to the Rust
types in src/types.rs
.
We plan on
trace.bin
.A future goal of this format is to make it possible to stream traces: to be able to replay them while they're still being recorded. This is one of the reasons for the decision to maintain a single "stream" of events currently.
We also define a Rust tracer library in src/tracer.rs
which can be used as a helper to instrument Rust-based language interpreters and vm-s.
It can make it easier to migrate to newer versions of the format, hiding many details behind its helpers.
There are a few examples and tests of its usage in src/lib.rs
.
There are some actual usages of it as well which can be also used as an example:
One can always directly produce the same traces from various languages. We're open for cooperation or discussion on usecases!
The library API docs can be built locally with:
cargo doc --all-features --no-deps
The generated HTML documentation will be placed under target/doc
. Open
target/doc/runtime_tracing/index.html
in a browser to inspect it.
After updating the version number in Cargo.toml
, publish a new release with:
cargo publish
Documentation for released versions will be automatically hosted on docs.rs.
Authored and maintained by Metacraft Labs, Ltd
LICENSE: MIT