Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3f5b42c
feat(stream_api): introduced trait TraceWriter
nickysn Jul 11, 2025
7213328
feat(stream_api): added function create_trace_writer
nickysn Jul 11, 2025
aeb455f
feat(stream_api): added function begin_writing_trace_events() to the …
nickysn Jul 14, 2025
8721213
feat(stream_api): added field Tracer::format
nickysn Jul 14, 2025
93942a5
feat(stream_api): set format in create_trace_writer()
nickysn Jul 14, 2025
899d70e
feat(stream_api): added trait TraceReader
nickysn Jul 14, 2025
d6e7f0e
feat(stream_api): implemented trace readers for both the json and bin…
nickysn Jul 14, 2025
adf777a
feat(stream_api): added and implemented method TraceWriter::add_event()
nickysn Jul 14, 2025
79030a2
feat(stream_api): added and implemented method TraceWriter::append_ev…
nickysn Jul 14, 2025
fb48b0a
feat(stream_api): export create_trace_reader and create_trace_writer …
nickysn Jul 14, 2025
342c795
feat(stream_api): derive debug, clone and copy for the TraceEventsFil…
nickysn Jul 15, 2025
361b07c
feat(stream_api): use the new API in runtime_tracing_cli
nickysn Jul 15, 2025
40a9ac6
feat(stream_api): return Result in TraceWriter::begin_writing_trace_e…
nickysn Jul 15, 2025
9821197
feat(stream_api): store the path in begin_writing_trace_events
nickysn Jul 15, 2025
594c901
feat(stream_api): removed the format parameter from TraceWriter::stor…
nickysn Jul 15, 2025
ed68f58
feat(stream_api): removed the path parameter from TraceWriter::store_…
nickysn Jul 15, 2025
009d3dd
feat(stream_api): removed unused 'use'
nickysn Jul 15, 2025
7cdd9cd
feat(stream_api): store_trace_events() renamed finish_writing_trace_e…
nickysn Jul 15, 2025
100b5d7
feat(stream_api): update test test_binary_roundtrip to use the new API
nickysn Jul 15, 2025
3cde38a
feat(stream_api): the Tracer struct was renamed NonStreamingTraceWriter
nickysn Jul 15, 2025
b8cbbbe
feat(stream_api): added check and panic, when finish_writing_trace_ev…
nickysn Jul 15, 2025
6a21f95
feat(stream_api): introduced begin_writing_trace_metadata and begin_w…
nickysn Jul 15, 2025
9d8f046
feat(stream_api): method store_trace_metadata renamed finish_writing_…
nickysn Jul 15, 2025
775817a
feat(stream_api): method store_trace_paths renamed finish_writing_tra…
nickysn Jul 15, 2025
da7cff1
feat(stream_api): removed the parameter path from finish_writing_trac…
nickysn Jul 15, 2025
b1440f2
feat(stream_api): removed the parameter path from finish_writing_trac…
nickysn Jul 15, 2025
141001c
feat(stream_api): methods finish_writing_trace_* now take a mutable s…
nickysn Jul 15, 2025
64074a2
feat(stream_api): also reexport the TraceReader trait
nickysn Jul 15, 2025
4398822
chore: cargo fmt
nickysn Jul 15, 2025
edd7065
chore: bump runtime_tracing version to 0.13.0
nickysn Jul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions runtime_tracing/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fn main() {
::capnpc::CompilerCommand::new()
.file("src/trace.capnp")
.run()
.expect("compiling schema")
::capnpc::CompilerCommand::new().file("src/trace.capnp").run().expect("compiling schema")
}
4 changes: 3 additions & 1 deletion runtime_tracing/src/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ pub fn serialize<S: Serializer>(v: &Vec<u8>, s: S) -> Result<S::Ok, S::Error> {

pub fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Vec<u8>, D::Error> {
let base64 = String::deserialize(d)?;
base64::engine::general_purpose::STANDARD.decode(base64.as_bytes()).map_err(serde::de::Error::custom)
base64::engine::general_purpose::STANDARD
.decode(base64.as_bytes())
.map_err(serde::de::Error::custom)
}
238 changes: 69 additions & 169 deletions runtime_tracing/src/capnptrace.rs

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions runtime_tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
//! This crate provides the [`Tracer`] type for emitting trace events and a
//! collection of serializable structures describing the trace format.
//! The format is documented in `docs/` and the README.
mod tracer;
mod types;
mod base64;
mod capnptrace;
pub use crate::tracer::{Tracer, TraceEventsFileFormat, NONE_TYPE_ID, NONE_VALUE};
mod tracer;
mod types;
pub use crate::tracer::{
create_trace_reader, create_trace_writer, NonStreamingTraceWriter, TraceEventsFileFormat, TraceReader, TraceWriter, NONE_TYPE_ID, NONE_VALUE,
};
pub use crate::types::*;

pub mod trace_capnp {
Expand All @@ -27,7 +29,7 @@ mod tests {

#[test]
fn test_simple_trace() {
let mut tracer = Tracer::new("path.small", &vec![]);
let mut tracer = NonStreamingTraceWriter::new("path.small", &vec![]);
let path = Path::new("/test/path.small");
tracer.start(path, Line(1));
tracer.register_step(path, Line(1));
Expand Down
Loading